I need to open a text file and check to make sure that a value I have already identified (strObject) can be found anywhere in the file. So what I have looks like:
Dim ObjectReader As New StreamReader("C:\Adtrav\UAB\OBJECT.TXT")
Dim lineRead As String
Dim objectPresent As Boolean
Do Until Microsoft.VisualBasic.Left(lineRead, 7) = strObject
lineRead = ObjectReader.ReadLine()
MsgBox("Can't find Object")
Dont pay too much attention to the try catch piece as I dont really know what I was doing there. The only reason I am using readLine methods is because I cant seem to find a method that will just search the entire text block and find a string that I tell it to search for. If there is a method like this please let me know. But somehow or another I need to check the text file and see if I cant find a string. Right now my Do Until Loop will go into an unterminating loop if if cannot find the string I tell it to look for. So if I am doing this the best way by using a loop to run through each line what do I do to make what I have above correct, or is there a better way to simply search the entire stream for strObject? Very urgent!