Coding again ...

Sep 01, 2006 13:52

Ok, in grand project that just won't end ... I made fabulous progress ... but ... have now hit a roadblock ( Read more... )

Leave a comment

Comments 2

grover173 September 1 2006, 18:15:34 UTC
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.

Reply


anonymous September 1 2006, 19:14:27 UTC
Is a batch file okay?

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

Up