I have to make an edit to a file and what I was planning to do is open
the file to read, then compare each line read to see if it equals my
search value, which is a substring of what is probably there. If it
does not, simply write it to another file. If it does = my search,
simply replace the value with my edit and write to the other file. I
would do this until the original file is at end. I would then like to
move my new file over the original, which should now include my edit.
Or
Open File for Read
Open Other File for Right
'read through first file
While file not at end
If line contains my search substring
replace line to include new substring
write it to other file
else
write line to other file
End if
End While
Close new file
Close original file
Move new file to original
Done!
Any guidance from a vbscript wiz would be greatly appreciated!
Thanks!!!