Results 1 to 3 of 3

Thread: FILE INPUT DELIMETERS

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    62
    I am using the input statement to read in data from a file,

    Input #1, strInput

    Some of the lines of the file have a comma in them, which cuts off the input and puts the rest of the line into the next input statement(i am using a do while loop).

    I know that the Input Function does not use delimeters, but you have to specify the number of characters to read in. I do not know how many characters to read in because each line is a different size.

    I guess my question is: Can I somehow make the Input Statement not use commas as a delimeter?

    Thanks,
    JK

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    new project..listbox..command button.

    'your LineInput function will work as well
    'but this is pretty neat.

    'change C:\my documents\try.txt" to your file.

    'the results are what you want.

    Option Explicit
    Option Compare Text


    Dim filesys, txtStream As Object


    Private Sub Form_Load()
    Dim myArr() As Variant
    Dim i As Integer
    Set filesys = CreateObject("Scripting.FileSystemObject")
    Set txtStream = filesys.openTextFile("C:\my documents\try.txt")
    Do Until txtStream.atendofstream
    List1.AddItem txtStream.readline
    Loop
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    62
    I used Line Input # statement and it works great.

    Thanks
    jk

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