Is there an easy way to open a text file and modify only a part of it?

  • Thread starter Thread starter muster
  • Start date Start date
M

muster

now I open the file and copy it to another file line by line and
change lines need to be changed.

Is there an easy way? It looks like an INI file but not really is a
INI file.

Thank you,
 
It depends on the format that you require and what Excel can give you.
You could open and edit in Excel then save as text.

If it has an INI file structure you can use the API calls like
GetPrivateProfileString:
http://vbnet.mvps.org/code/file/pprofilebasic.htm

Otherwise you would need to read the whole file into a string/array. Make
the changes. Write the whole file to a new file. Kill the old.

NickHK
 

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