AndersEgleus
01-21-2004, 08:53 PM
Hi. I'm having some problems understanding the Mel docs about the "r", "w", "a" modes when opening a file.
What I want to do is print some stuff to a file (clearing it first to overwrite any old file - that would be the "w" mode I suppose), then I want to go back to a specified line in the file and insert some text (or overwrite) at that line.
I've tried storing the "chunks" of text as strings first and then printing them to the file in the order I want them, but this method (although it works) slows my script down about 10 times.
Does anyone have any idea how to do this?
What I want to do is print some stuff to a file (clearing it first to overwrite any old file - that would be the "w" mode I suppose), then I want to go back to a specified line in the file and insert some text (or overwrite) at that line.
I've tried storing the "chunks" of text as strings first and then printing them to the file in the order I want them, but this method (although it works) slows my script down about 10 times.
Does anyone have any idea how to do this?
