wz2jrz
04-23-2003, 01:50 PM
Hi,
I am reading a text file having formatting characters.
Several lines in the text file consists of tab(s) ...
I am looking for a search pattern say 'var' in a line consisting tabs.
there are two tabs before 'var' and one after
"[tab][tab]var[tab]" ---> this is how the line looks inside the text file
How can i search for such pattern in a formatted line?
or how can i search with the tabs included in the search pattern?
my basic objective is to search for only "[tab][tab]var[tab]" lines and NOT the ones like 'var_x' or 'num_var' or 'num_var_left'
My following code does not meet the desired logic..
'------Here's my code -------
Set fs = CreateObject("Scripting.FileSystemObject")
Set file_ptr = fs.OpenTextFile(wad_file, ForReading)
Do While file_ptr.AtEndOfStream <> True
mystring = file_ptr.readline
End If
If LCase(Left(Trim(mystring), 3)) = "var" Or InStr(Trim(mystring), " var ") > 0 Then
.... do something ....
thanks in advance for any help!
Nimish
I am reading a text file having formatting characters.
Several lines in the text file consists of tab(s) ...
I am looking for a search pattern say 'var' in a line consisting tabs.
there are two tabs before 'var' and one after
"[tab][tab]var[tab]" ---> this is how the line looks inside the text file
How can i search for such pattern in a formatted line?
or how can i search with the tabs included in the search pattern?
my basic objective is to search for only "[tab][tab]var[tab]" lines and NOT the ones like 'var_x' or 'num_var' or 'num_var_left'
My following code does not meet the desired logic..
'------Here's my code -------
Set fs = CreateObject("Scripting.FileSystemObject")
Set file_ptr = fs.OpenTextFile(wad_file, ForReading)
Do While file_ptr.AtEndOfStream <> True
mystring = file_ptr.readline
End If
If LCase(Left(Trim(mystring), 3)) = "var" Or InStr(Trim(mystring), " var ") > 0 Then
.... do something ....
thanks in advance for any help!
Nimish