From: Robert Klemme Date: 2007-11-10T06:10:04+09:00 Subject: Re: How to edit a file without loading it all into memory On 09.11.2007 21:51, Jonathan Dobbie wrote: > I need to change the texture paths in maya files. The lines are easy to > find with grep, and I'm able to create the new line easily enough, but > how can I do this without holding the entire file into memory? The > files can be hundreds of megabytes. As you said: do it line by line. This is the usual approach to this problem. You might want to have a look at Ruby's command line options. Basically you can do something like this for an inplace edit: ruby -ni.bak -e 'your replacement code' Kind regards robert