I want to do a Line Input after I found a certain word. So, if I found the word through a text file, I want to do the Line Input in the next line.
Any suggestion???
Printable View
I want to do a Line Input after I found a certain word. So, if I found the word through a text file, I want to do the Line Input in the next line.
Any suggestion???
That what you want?Code:Open "C:\Textfile.txt" For Input As #1
Line Input #1, strLine$
Text1.text = Text1.text & strLine$
Close #1
Thanks Matthrew but I already got that part.
Example of my text file
User1
User2
User3
User4
User5
User6
Beside using a loop going through each line, how can I get the line after I find User2. In this example, once I use instr to find "User2", it should return the next line which is "User3".
Does anyone understand what I mean?
I want to find a word using instr function and get the next line of data. Is it possible to do a Line Input in the middle of the text file?
Thanks
It is of course, if you only know where to start reading, use seek statement and function to locate next position to read.
What is the difference with these two?
Loc(1) & Seek(1)
What is the difference with these two?
Filelen and LOF(1)
[Edited by James Bond 007 on 10-31-2000 at 03:25 AM]
no diff between loc and seek functions
Filelen needs a filename and lof needs a open filenumber
Filelen is used when the file is not open.
LOF only works if the file is open.
H.