-
Hi,
The text file contains several records in the same format (see below). Each record is 2 lines of data. I need to search the file for a specific record (eq. Record857 - see below). Once I find it, I need to read in 5th item from the NEXT line in the record (221 - see below).
------------------------------------------------
Sample of the text file
------------------------------------------------
Record055 455 331
23 392 112 665 999 3563
Record857 928 021
66 947 446 535 221 0083
Record726 664 222
40 372 220 11 102 2223
------------------------------------------------
Thanks
-
Hmmm
First try using line input.
Code:
Dim X() as string
Open "Filename" for input as #1
Do while not EOF(1)
Line INput#1, Temp$
if left(temp$,9) = "Record857" then
'You have located it
'Do another line input to get the next line
Line Input#1,Temp$
X = Split(Temp$)
'X(4) should contain your data
exit sub ' found it....now exit sub
end if
loop
Did this off the top of my head...hope it works
(if someone notices error please correct!)
-
Oops...