Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    8

    Unanswered: Which library must be ref'd for reading text

    Hi There,
    I was looking to read and write some text files and was wondering which library must be referenced. Thanks
    Chris

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Which library must be ref'd for reading text

    to read the contents of a text file you don't need any library, but you will need to know how the file is delimited. If you can give me an idea of how your file is delimited, I can whip up some code for you. The code however that you need to use is the following ...

    Open "c:\filename.txt" For Input As #1
    Input #1, strContentFromFile
    Close #1


    The above code will read the first line of the text file.

    If you had a list of names, with carriage returns between the names the following will work.

    Open "c:\filename.txt" For Input As #1
    Do Until EOF(1)
    Input #1, strContentFromFile
    'here you will need to write code to do something with the firstname read ..and so on
    Loop
    Close #1

    Hope this is a starting point ... but more that happy to whip up some code if I knew what the textfile content would look like ...

    Originally posted by cmthomps
    Hi There,
    I was looking to read and write some text files and was wondering which library must be referenced. Thanks
    Chris

Posting Permissions

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