If you install the Facets gem (the command: "gem install facets") it can be as easy as:
Facets adds the rewrite method to File which makes it easy to do what you want.
A good workman is known by his tools.
Chris Dancy
Ranch Hand
Joined: Feb 14, 2006
Posts: 136
posted
0
That's pretty sweet Marc. What I ended up doing was reading the entire file into an array and editing the lines there then re-writing the file .... however what I wanted to do was exactly what you just should me. I will have to play around with that snippet of code. Thanks for showing me.
subject: Question with reading and editing lines in a file