Results 1 to 7 of 7

Thread: Input From text files

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Dallas,Tx,USA
    Posts
    30

    Post

    The text file that i am inputing from looks like this

    11111de|Machine|Whatever|ok

    Open "TEXTFILE" For Input As #1
    Input #1, line1

    The string i get for line1 is 11111

    The string that i want to get is (the whole line) 11111de|Machine|Whatever|ok

    I know it probaly has something to do with the pipe character ("|") please help.

    Mark

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,

    Try:

    Line Input#1,line1

    From Help.

    Line Input # Statement

    Reads a single line from an open sequential file and assigns it to a String variable.

    Syntax

    Line Input #filenumber, varname

    The Line Input # statement syntax has these parts:

    Part Description

    filenumber Required. Any valid file number.
    varname Required. Valid Variant or String variable name.


    Remarks

    Data read with Line Input # is usually written from a file with Print #.
    The Line Input # statement reads from a file one character at a time until it encounters a carriage return (Chr(13)) or carriage return–linefeed (Chr(13) + Chr(10)) sequence. Carriage return–linefeed sequences are skipped rather than appended to the character string.
    Al.

  3. #3
    Member
    Join Date
    Feb 2000
    Posts
    43

    Post

    hmmm not sure, but maybe try LINE INPUT #1, etc..(if that is even valid in VB... works in qbasic

    ------------------
    Rapmaster

  4. #4
    Member
    Join Date
    Feb 2000
    Posts
    43

    Post

    hehe Al... I guess we had the same idea

    ------------------
    Rapmaster

  5. #5
    Guest

    Post

    try the Line Input #1 statement instead

  6. #6
    Member
    Join Date
    Feb 2000
    Posts
    43

    Post

    hehe 3 people posting the same thing at the same time

    ------------------
    Rapmaster

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Dallas,Tx,USA
    Posts
    30

    Post

    Thanks i appreciate it.

    Line Input works great........

    Mark

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