View Full Version : readin writing files

10 October 2006, 12:58 PM

I want to edit line a HUGE text file and save it. I just want to replace a couple of words from line 3,4,5;

Wat I am doing right now is reading the file,replacing line 3,4,5 by using a gmatch condition and then just reading the rest of the file and writing the result to a new file. My problem is that the reading is really slow and my purpose is just to replace few lines in the beginning. So wat can I do? Theres no "M" mode to modify file.I just want to copy the huge file as another using sysFile copy and just edit the line 3,4,5 and save it!

any thoughts?

Robert Bateman
10 October 2006, 04:08 PM
Correct, there's no M because it's "r+"

CGTalk Moderation
10 October 2006, 04:08 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.