Search This Blog

Monday, August 16, 2010

How to search for data in a tab separated log file

Set Fso = CreateObject("Scripting.FileSystemObject")

Const ForReading = 1, ForWriting = 2
Set File1 = Fso.OpenTextFile ("abc.txt", ForReading, True)


Do While File1.AtEndOfStream <> True

text = File1.ReadLine()
newtext = replace (text, " ", " ")' Copy the tab from the Notepad and paste here.For details check the syntax for Replace function in QTP help

data = split (newtext, " ")
For i = Lbound(data) to UBound(data)
If data(i) = "TimeStamp" Then
msgbox "true"
End If
Next
Loop

No comments:

Post a Comment