#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    10
    Rep Power
    0

    Getting lines from a text files


    Hi, I know how to get line 1 from a text file, but how do I get the others. Like Line 1 goes to text1, line 2 goes to text2 and so on. Any help???
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    use the eof() function with a loop to read through the text file.
    Code:
    public sub getFile(byVal fileName as String)
        dim iFp as Integer
        dim strFileLine as String
    
        iFp = Freefile
        Open fileName for Input as #iFp
        while not EOF(iFp)
            Line Input #iFp, strFileLine
            'do what you want with the line
        wend
        Close #iFp
    end Sub
    ***untested code***

IMN logo majestic logo threadwatch logo seochat tools logo