I think using the temp file and replacing is a good way. also lets you revert if something goes wrong. See this Stackoverflow discussion of a similar question: http://stackoverflow.com/questions/5452781/edit-each-line-in-a-file-in-ruby
Reading all the info into memory, performing the work, then writing it out is another way but large files can be an issue If your worried about performance, i suggest doing some measuring to see if its really an issue and whether your planned solution is really better -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
