-
Hello!
I have a text-file with 3 records:
test1;xxx;abc
test2;lalala;efg
test3.blah;xyz
so, I whant search this text file for like that start from "test2" and set value of strTest to string I have found in a file. Can somebody help me with this?
Thank all!
Regards,
Victor
-
assuming your including the second line in the search...
Code:
dim intX as integer
dim f as integer
f = freefile
open "C:\MyFile.txt" for input as #f
line input #f, strTest 'this overlooks the first line in the file
do while not EOF(f)
line input #f, strTest
if instr(strTest, SearchStr) > 0 then Exit Do
loop
Close #f
this should leave strTest with the entire line that was found to contain your string, is this what you wanted?