Solved: script question, suggestions needed... I am writting some code to parse a directory contents into a text file, how ever here is my problem, since customer can modify to directories there are no static names. I was looking a vbs script solution to search a line with a text file and delete all text to the left of the '\' also this would have to be nested since each line could have multiple subdirectories, any ideas would be appreciated.
Thanks again for any input.
Modifed:
If I could find a way to read a text file, save the line into a string variable called current_line and then execute this segment and then write the modified current_line back into the original file at the same point.
here is the last code before i got stuck:::
fspec="list.txt"
set fso=createobject("scripting.filesystemobject")
set ots=fso.opentextfile(fspec)
do while not ots.atendofstream
s=ots.readline
'do thing with the info
dim Result
Result = InStrRev(s, "\")
s = Mid(s,(result+1))
ots.Write(s) 'problemed line thus far
'(10, 6) Microsoft VBScript runtime error: Bad file mode
loop
ots.close
set ots=nothing
set fso=nothing
this would work, thanks for your assistance...
Last edited by slafta : 03-Dec-2008 12:19 AM.
|