I've been doing this for 20+ years, I know how to read/write text files. "
Sorry, really, I am not trying to step on your toes. I am simply trying to answer the OP.
The OP asked: "What I need is to open a text file and make some changes by a micro, such as adding a string in a line or adding a line. Then save the modified file back to txt format. "
ettienne said:
If you open a file for Append then you can Write/Print to it. This creates a new file if it does not exist and appends to an existing file. Correct?
Correct. And is this not what the OP is asking for?
So, the answer is
for the OP is, yes you can do that. Although, technically you are not, of course, saving the file
back to txt format. You are opening it as text format, "adding a string in a line or adding a line", and closing it as a text file. The closed file has those added strings.
I really do not know what you mean by: "I was not referring to the Write() function but to write or output to a file."
The Write() function writes to the file. And if I understand the OP correctly (and I could be wrong!), they probably want to use Print not Write, as it does not add the quotation marks.
Anyway, I am sorry if you feel I offended you in any way; I was simply trying to answer the OP.
"A little piece of heaven
without that awkward dying part."
advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)
Gerry