Help parsing text file
Any help would be much appreciated. I am new to scripting and I am trying to parse a text file to find a value and write it to a new file..
Example
The file Test.txt:
4:38 PM 1/11/2002
Volume vld3a
working.........
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Jan 02 12:02 eloginfo__exvsi__recent
0% ( 0%) 0% ( 0%) Jan 02 11:02 eloginfo__01-02-2002_11.00.00
0% ( 0%) 0% ( 0%) Jan 02 10:03 eloginfo__01-02-2002_10.00.00
I want to get the elog* values written to a new file test1.txt
So test1.text would be
eloginfo__exvsi__recent
eloginfo__01-02-2002_11.00.00
eloginfo__01-02-2002_10.00.00
Here is what I have so far.
Set WshShell = CreateObject("WScript.Shell"
Const ForReading = 1, ForWriting = 2, ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject"
set f = fso.GetFile("C:\test.txt"
set ts = f.OpenAsTextStream(ForReading, -2)
TextStreamTest = ts.read(3)
Do While not ts.AtEndOfStream
myText =myText & ts.readline & vbCrLf
loop
wscript.echo mytext
Any help would be much appreciated.
Thx
Jeff
Any help would be much appreciated. I am new to scripting and I am trying to parse a text file to find a value and write it to a new file..
Example
The file Test.txt:
4:38 PM 1/11/2002
Volume vld3a
working.........
%/used %/total date name
---------- ---------- ------------ --------
0% ( 0%) 0% ( 0%) Jan 02 12:02 eloginfo__exvsi__recent
0% ( 0%) 0% ( 0%) Jan 02 11:02 eloginfo__01-02-2002_11.00.00
0% ( 0%) 0% ( 0%) Jan 02 10:03 eloginfo__01-02-2002_10.00.00
I want to get the elog* values written to a new file test1.txt
So test1.text would be
eloginfo__exvsi__recent
eloginfo__01-02-2002_11.00.00
eloginfo__01-02-2002_10.00.00
Here is what I have so far.
Set WshShell = CreateObject("WScript.Shell"
Const ForReading = 1, ForWriting = 2, ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject"
set f = fso.GetFile("C:\test.txt"
set ts = f.OpenAsTextStream(ForReading, -2)
TextStreamTest = ts.read(3)
Do While not ts.AtEndOfStream
myText =myText & ts.readline & vbCrLf
loop
wscript.echo mytext
Any help would be much appreciated.
Thx
Jeff