2010/3/18 Shiny Hydra <slotriof / guerrillamailblock.com>:
>> So your file has fixed width records? =A0This is important to know,
>> otherwise approach 2 from below becomes tricky (you basically need to
>> read line by line in order to find the proper position whereas you
>> otherwise can calculate the position via record size).
>
> Yes, the records are all fixed width. =A0The width of the file is based o=
n
> the extension type.
>
>> Btw, is there a particular reason why you create what looks like a
>> relational database based on text files?
>
> I'm working off of a standard format that has been used for years
> (called Mail.dat). =A0Editing the files has been an extremely time
> consuming process, so I'm trying to write an automated script to batch
> replace specific parameters. =A0After doing some research, it seemed like
> Ruby was a great language to learn for this type of text manipulation
> and it turned out to be quite fun to boot.

That's good!  I hope you continue to enjoy your journey.

> I'm currently working through the book Beginning Ruby: From Novice to
> Professional, but it does not go very in depth on text file manipulation
> techniques. =A0I tried looking through the classes and methods online, bu=
t
> without a strong foundation in the language it's difficult to navigate
> that amount of information. =A0If you could provide any additional
> information it would be immensely helpful.

You could start with searching the archives of ruby-talk for "File"
and "seek".  That should give you some bits of code which deal with
file IO different from sequentially reading or writing.

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/