[Lvlug] 1. awk: Maximum Record Size;
2. Converting nedit macro to awk or Ruby
Randy Kramer
rhkramer at gmail.com
Wed Jan 10 11:12:08 EST 2007
On Wednesday 10 January 2007 01:16 am, Theerasak Photha wrote:
> On 1/10/07, Theerasak Photha <hanumizzle at gmail.com> wrote:
> > It depends heavily on the project being done.
> >
> > I wrote some RPG character generation and *management* (persistence
> > being the keyword here) software in Python, for tgta and now (the much
> > less cumbersome) Legendary Quest, so obviously objects win here. The
> > neat thing is I could just
>
> uh...YAML dump character sheets is what I meant to say.
Thanks! I think I can do it in awk, and I'm going to head down that path. I
may even try to do the full conversion (i.e., the one time for old stuff plus
the "continuous" for new stuff) in awk, then post it here and seek comments
on converting it to Ruby. Or, actually, maybe I have a concept of how to do
it in Ruby / object oriented approach:
* Create an object which basically will hold a single record
* Create methods to:
* read a single record from a file (into that object)
* methods to make the conversion (change the old record separator to the
new, increment a record counter, add various other header lines, etc.)
* a method to write that record to a(n individual) file
I'm not exactly sure how to loop through the entire input file, but that
sounds like something that should be easy and be obvious if I start to work
on such a program. Hmm, now I'm debating, maybe I'll consider Ruby more
seriously instead of awk.
Randy Kramer
More information about the Lvlug
mailing list