Greetings,
I was wondering if anyone knew of a simple/easy (emphasis on easy, I am a major beginner) to read through text files quickly, search for strings and pull information. I am currently using the 'StreamReader' function and 'InStr' command, but the files I am working with are gigantic and this is taking from 1/2 an hour to a few hours to work its way through.
I again have exhausted my google skills and am unable to comprehend most of what I find.
Any links or tips on commands to learn about would be greatly appreciated!
here is a sample of the code I am currently using - poke fun at will, I am a major newbie.
strContentsTime1_jntfor=0
Do Until strContentsTime1_jntfor Is Nothing
strContentsTime1_jntfor = objFile1.ReadLine()
'look for string 'time'
strFindStringTime_jntfor = "time"
intPositionTime_jntfor = InStr(strContentsTime1_jntfor, strFindStringTime_jntfor)
'if string 'time' is found, InStr function will return a positive integer, if not found it returns 0
'if inStr returns positive interger;
If intPositionTime_jntfor > 0 Then
'then take the 11 most right sided characters
strTime1_jntfor(intCounter2) = Microsoft.VisualBasic.Right(strContentsTime1_jntfor, 12)
dblTime1_jntfor(intCounter2) = Val(strTime1_jntfor(intCounter2))
intCounter2 = intCounter2 + 1
Else : Continue Do
End If
Loop
objFile1.Close()
I was wondering if anyone knew of a simple/easy (emphasis on easy, I am a major beginner) to read through text files quickly, search for strings and pull information. I am currently using the 'StreamReader' function and 'InStr' command, but the files I am working with are gigantic and this is taking from 1/2 an hour to a few hours to work its way through.
I again have exhausted my google skills and am unable to comprehend most of what I find.
Any links or tips on commands to learn about would be greatly appreciated!
here is a sample of the code I am currently using - poke fun at will, I am a major newbie.
strContentsTime1_jntfor=0
Do Until strContentsTime1_jntfor Is Nothing
strContentsTime1_jntfor = objFile1.ReadLine()
'look for string 'time'
strFindStringTime_jntfor = "time"
intPositionTime_jntfor = InStr(strContentsTime1_jntfor, strFindStringTime_jntfor)
'if string 'time' is found, InStr function will return a positive integer, if not found it returns 0
'if inStr returns positive interger;
If intPositionTime_jntfor > 0 Then
'then take the 11 most right sided characters
strTime1_jntfor(intCounter2) = Microsoft.VisualBasic.Right(strContentsTime1_jntfor, 12)
dblTime1_jntfor(intCounter2) = Val(strTime1_jntfor(intCounter2))
intCounter2 = intCounter2 + 1
Else : Continue Do
End If
Loop
objFile1.Close()
Last edited: