Results 1 to 2 of 2

Thread: Help!!! Text file...

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    3

    Unhappy

    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

  2. #2
    Guest
    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?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width