From: Dave Aronson Date: 2012-08-26T00:38:21+09:00 Subject: Re: Add a line into a file at multiple locations above a existing line On Fri, Aug 24, 2012 at 8:49 AM, Joel Pearson wrote: > The easiest way to do this is to read the file, edit it as a string, and > overwrite the file with the modified string. That depends how big the file is. If it's a gig or two, you might not be ABLE to do it that way. If it's smaller but still fairly large, you might be able, but it would cause you to start swapping. Besides, that's not all THAT much easier. Or you can use -i on the Ruby command line for in-place regex subbing, just like in Perl. -Dave -- Dave Aronson, Available Secret-Cleared Ruby/Rails Freelancer (VA/DC/Remote) www.DaveAronson.com www.Codosaur.us www.Dare2XL.com www.RecruitingRants.com