I have a file and I need to search for a string of text and replace that line with another line of text. What's the best way to do this?
Thanks
Printable View
I have a file and I need to search for a string of text and replace that line with another line of text. What's the best way to do this?
Thanks
'with the replace function; try that:
MyString = "abcdefghij"
Replace(MyString,"def","DEF")
'MyString will be now "abcDEFghij"
'tell me if it helps
I need to be able to replace the whole line in the file. I think with 'replace' I would have to read the file into a variable and write it back to the file. Is there an easier way to do this? If not, I can just read the file into a variable and do it.
Thanks.