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
 
Hi ALF,

Is it a textfile form one string or a textfile with lines with CRLF in it?

Cor
 
* "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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top