I am opening a text file, counting the number of lines, then processing it.
I am sure there must be a simple way to get back to the first line after counting, but I cant find it so I just close the file and open it again...
Something like:
BOF #1
??
Can anyone help?
I am sure there must be a simple way to get back to the first line after counting, but I cant find it so I just close the file and open it again...
Code:
Open "M:\Mining\Unibis\oe404v3.txt" For Input As #1
'count number of lines
count1 = 0
Do While Not EOF(1)
Line Input #1, ThisString
Count = Count + 1
Loop
Total1 = count1
count1 = 0
Close #1
'now open again to process it
Open "M:\Mining\Unibis\oe404v3.txt" For Input As #1
While Not EOF(1)
Line Input #1, ThisString
' do whatever
Wend
Close #1
Something like:
BOF #1
??
Can anyone help?
Last edited: