Editing text files

  • Thread starter Thread starter ALF
  • Start date Start date
A

ALF

What's easiest way to replace a particular text string in
a text file by another and save the modified file?

Currently I know how to open a file, read the text
string, place it in a variable, and modify the string.
What I'd like to know is how to save the modified string
in the same file.

The alternative that's I'm trying to avoid is to create a
temporary auxiliary file in the process.

Any help is appreciated

Thanks
ALF
 
* "ALF said:
It is a text file with lines with CRLF in it.

I think the way to go depends on the size of the file. The solution
will be different if files are always very small and if the file's size
is 2 GB.
 
The file size will never exceed 4 MB.

ALF
-----Original Message-----


I think the way to go depends on the size of the file. The solution
will be different if files are always very small and if the file's size
is 2 GB.
 
Back
Top