Results 1 to 6 of 6

Thread: text files?

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    What's the best way to read a text file line by line?

    line input is fine for reading the data but how to do you
    continue to the next line and stop at the end
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Talking Do While...

    Code:
    Open "Filename" for Input as #1
    Do While Not EOF (1)  '1 is the file number (open...for..as #1)
    LineInput #1,strVariable
    'Do your stuff here for each line
    loop
    
    Close #1
    thats it!

    Hope this helps


    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I know it's just a typo, but it case somebody gets stuck:

    Code:
    LineInput #1
    should be
    Line Input #1
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Talking Jop!

    JOP! you think your Sooooo Smart catching other peoples mistakes! Well let me tell YOU somethin.....

    Thanks



    Good catch...

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    Thx for the help

    I figured it out a few seconds after i posted it.
    I thought u had to treat it like a DB and move to the next
    line manually. Guess not, it's simple for once

    thanks fellas
    Bababooey
    Tatatoothy
    Mamamonkey

  6. #6
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    JOP! you think your Sooooo Smart catching other peoples mistakes! Well let me tell YOU somethin.....

    Thanks

    Good catch...
    hehe
    at least your not that type a guy that starts whining when I correct somebody I've seen that lots of times happening here.

    Have a nice day
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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