TextStream.ReadLine Mac Newline

Discussion in 'ASP General' started by mike.biang@gmail.com, Jan 8, 2007.

  1. Guest

    I am using the textstream object to read a CSV file and parse through
    the fields. I use the readline() method to read in each line of the
    file, and parse the contents into the values of the different fields.

    With files generated on a windows system, this works fine.

    However, when working with CSV files genereated through Excel on a Mac,
    the entire contents of the file is read when I make the first ReadLine
    call. I imagine that this is because Mac uses a different newline
    character than windows machines do (Carraige Return vc Carraige Return
    + Line Feed). I'm theorizing that ReadLine doesn't recognize just the
    Carraige Return generated by a Mac.

    Has anyone encountered an issue like this, or does anyone know of any
    work arounds?

    Thanks!
    Mike Biang
    mike -at- cramerdev dot com
     
    , Jan 8, 2007
    #1
    1. Advertising

  2. Guest

    I found my own solution. Doing a bit more in depth search solved the
    problem.

    http://groups.google.com/group/micr...4190bebf14?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8


    wrote:
    > I am using the textstream object to read a CSV file and parse through
    > the fields. I use the readline() method to read in each line of the
    > file, and parse the contents into the values of the different fields.
    >
    > With files generated on a windows system, this works fine.
    >
    > However, when working with CSV files genereated through Excel on a Mac,
    > the entire contents of the file is read when I make the first ReadLine
    > call. I imagine that this is because Mac uses a different newline
    > character than windows machines do (Carraige Return vc Carraige Return
    > + Line Feed). I'm theorizing that ReadLine doesn't recognize just the
    > Carraige Return generated by a Mac.
    >
    > Has anyone encountered an issue like this, or does anyone know of any
    > work arounds?
    >
    > Thanks!
    > Mike Biang
    > mike -at- cramerdev dot com
     
    , Jan 9, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arthur
    Replies:
    0
    Views:
    425
    Arthur
    Feb 7, 2006
  2. risa

    ASP Textstream question

    risa, Jul 3, 2003, in forum: ASP General
    Replies:
    3
    Views:
    141
    Aaron Bertrand [MVP]
    Jul 3, 2003
  3. Steve Bright

    TextStream Line Truncation

    Steve Bright, Jul 8, 2003, in forum: ASP General
    Replies:
    0
    Views:
    111
    Steve Bright
    Jul 8, 2003
  4. George Hester
    Replies:
    3
    Views:
    218
    Ray at
    Dec 1, 2003
  5. K Richard Pixley
    Replies:
    3
    Views:
    373
    Ned Deily
    Jan 3, 2012
Loading...

Share This Page