Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem reading tab delimited file

Reply
Thread Tools

Problem reading tab delimited file

 
 
iamreallynewhere@sbcglobal.net
Guest
Posts: n/a
 
      05-07-2005
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?

 
Reply With Quote
 
 
 
 
Kevin McMurtrie
Guest
Posts: n/a
 
      05-07-2005
In article < .com>,
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.
 
Reply With Quote
 
 
 
 
iamreallynewhere@sbcglobal.net
Guest
Posts: n/a
 
      05-08-2005
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.

 
Reply With Quote
 
iamreallynewhere@sbcglobal.net
Guest
Posts: n/a
 
      05-09-2005
Does anyone have sample code that will do this?

 
Reply With Quote
 
.
Guest
Posts: n/a
 
      05-09-2005
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

 
Reply With Quote
 
iamreallynewhere@sbcglobal.net
Guest
Posts: n/a
 
      05-10-2005
You are correct. I am using readLine and this is the first time it
hasn't fit my needs. What should I use?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Reading tab-delimited files with STL AnonMail2005@gmail.com C++ 2 01-12-2010 04:22 AM
Re: Reading tab-delimited files with STL nick C++ 2 01-12-2010 03:08 AM
Re: Reading tab-delimited files with STL Jerry Coffin C++ 2 01-10-2010 06:22 PM
Reading a tab delimited text file. Stephen Python 5 02-23-2009 11:37 PM
convert non-delimited to delimited RyanL Python 6 08-28-2007 12:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57