My immediate thought in VBScript would be not to delete the line, but instead write each line you need into a new file. Omit the line you don't want, then save the new file and either overwrite the old file, or save new->delete old->rename new to old.
It's been a loooong time since I've used VBScript to open a text file and manipulate it, though, so i don't remember if you can open a file, remove text, and then save and close it.
Comments 2
It's been a loooong time since I've used VBScript to open a text file and manipulate it, though, so i don't remember if you can open a file, remove text, and then save and close it.
Reply
rename file.txt file.bak
findstr /v searchstring file.bak > file.txt
findstr is included in Win2k and up, if you need it on another OS then use a win32 copy of grep.
You can use for /f to iterate through a series of files as well (for /? for details).
Reply
Leave a comment