Hi there,
Can anyone explain how to run a replace text string and amend a file in vbscript.
Example replace all "test" in txt file log.txt
Printable View
Hi there,
Can anyone explain how to run a replace text string and amend a file in vbscript.
Example replace all "test" in txt file log.txt
hi
Scripting.FileSystemObject has the full role in this process. this link will provide you details abt the object.
you have to read each line of the source file. replace the "test" in every line using replace() in vbscript. and write it to another file, say a temp file. after full copy close the source and temp files. then delete the original file and rename the temp file to the original filename.