Problem reading tab delimited file

Discussion in 'Java' started by iamreallynewhere@sbcglobal.net, May 7, 2005.

  1. Guest

    I know how to read in a tab delimited file, but I am having problems
    reading one without ignoring line breaks. The text I am trying to read
    has line breaks in paragraphs that I would like to keep as one token.

    Is there a way to read in a text file while ignoring actual line breaks
    and using my own special character to break up the lines?
    , May 7, 2005
    #1
    1. Advertising

  2. In article <>,
    wrote:

    > I know how to read in a tab delimited file, but I am having problems
    > reading one without ignoring line breaks. The text I am trying to read
    > has line breaks in paragraphs that I would like to keep as one token.
    >
    > Is there a way to read in a text file while ignoring actual line breaks
    > and using my own special character to break up the lines?


    Yeah. When you see a tab, that's a delimiter. Otherwise, keep reading.
    Hope that helps.
    Kevin McMurtrie, May 7, 2005
    #2
    1. Advertising

  3. Guest

    Can I use a tab as the delimiter and something besides a carriage
    return for the line break? I want a special character to equal a line
    break instead of an actual line break.
    , May 8, 2005
    #3
  4. Guest

    Does anyone have sample code that will do this?
    , May 9, 2005
    #4
  5. . Guest

    On Sat, 7 May 2005 wrote:

    > I know how to read in a tab delimited file, but I am having problems
    > reading one without ignoring line breaks. The text I am trying to read
    > has line breaks in paragraphs that I would like to keep as one token.
    >
    > Is there a way to read in a text file while ignoring actual line breaks
    > and using my own special character to break up the lines?


    You don't tell us how you are reading in from the file but I can guess:

    Quit using readLine(). By definition it will read up to the first carriage
    return or new line character. Write your own method.

    --
    Send e-mail to: darrell dot grainger at utoronto dot ca
    ., May 9, 2005
    #5
  6. Guest

    You are correct. I am using readLine and this is the first time it
    hasn't fit my needs. What should I use?
    , May 10, 2005
    #6
    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. Stephen
    Replies:
    5
    Views:
    5,447
    harijay
    Feb 23, 2009
  2. Jerry Coffin
    Replies:
    2
    Views:
    905
  3. nick
    Replies:
    2
    Views:
    409
  4. Replies:
    2
    Views:
    1,357
  5. Replies:
    1
    Views:
    311
    ZedGama3
    Apr 14, 2004
Loading...

Share This Page