我正在寻求帮助以读取日志文件,其中日志文件在日志中具有当前日期,我想从那里读取所有行并查找错误以输出当前日期的错误。
我的示例日志文件
[10/12/2012 testing the app1
[10/13/2012 testing the app2
[10/14/2012 testing the app3
[10/15/2012 testing the app4
我未完成的 vbscript:
Const ForReading = 1
Dim strSearchFor
strSearchFor = "currentdate in the log file"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("mylogfile.log", ForReading)
strLine = objTextFile.ReadLine
If log contains (inside mylogfile.log file the) current date then ' I am looking help to write the code here...
Wscript.Echo "we found current date"
Else
Wscript.Echo "We did not found current date"
End If
在这方面寻求帮助......非常感谢......提前......