Parsing newbie here - I've perused this newsgroup and also msdn and have
been unable to piece together a solution.
I have a logfile of Servers that looks like this:
System information for \\DS02K2:
Uptime: 67 days 6 hours 39 minutes 23 seconds
Kernel version: Microsoft Windows NT, Uniprocessor Free
Product type: Workstation
Product version: 4.0
Service pack: 6
Kernel build number: 1381
Registered organization: Org
Registered owner: Owner
Install date: 12/1/2000, 1:07:12 PM
Activation status: Not applicable
IE version: 5.0100
System root: C:\WINNT
Processors: 1
Processor speed: 600 MHz
Processor type: Intel Pentium III
Physical memory: 128 MB
Video driver: ATI Technologies Inc. 3D RAGE IIC
System information for \\DS01K2:
Uptime: 6 days 8 hours 16 minutes 44 seconds
Kernel version: Microsoft Windows NT, Uniprocessor Free
Product type: Server
Product version: 4.0
Service pack: 6
Kernel build number: 1381
Registered organization: Org
Registered owner: Owner
Install date: 5/25/2001, 1:18:09 PM
Activation status: Not applicable
IE version: 6.0000
System root: C:\WINNT
Processors: 1
Processor speed: 865 MHz
Processor type: Intel Pentium III
Physical memory: 382 MB
Video driver: Matrox Graphics Marvel G200
I need to parse this logfile and return Servername and Processor Speed ONLY.
I've tried SkipLine in a For Next loop to take me down to the Processor
Speed line but haven't been able to get that to function properly.
So far I have something like this:
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\log\srvinfolog.txt", _
ForReading)
Do
strLinetoParse = objTextFile.ReadLine
dtmServerName = Mid(strLinetoParse, 26, 15)
Wscript.Echo "Server: " & dtmServerName
dtmProcessorSpeed = Mid(strLinetoParse, 28, 10)
wscript.Echo "Speed: " & dtmProcessorSpeed
Loop until objTextFile.atEndofStream
objTextFile.Close
Thanks for any help you can provide - this will be a valuable learning
exercise and answered question that won't be repeated.