Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read a textfile line by line

Status
Not open for further replies.

shangrilla

Programmer
Nov 21, 2001
360
US
I get a text file without any line breaks.
It looks something like this:

1234567890~ABCDEFGH~0987654321~HHGFEDCBA~

So ~ means a line break.

I am using the streamreader.readline() method and it works fine when the file is like:
1234567890~
ABCDEFGH~
0987654321~
HHGFEDCBA~

How Can I read 1234567890~ABCDEFGH~0987654321~HHGFEDCBA~

Thanks in advance?
 
Shan,
Try preprocessing your file by reading it with a stream.readbyte method. If your byte is not a ~, write it to an intermediate file using stream.writebyte. If it is a ~
then write the ~ followed by a 0x0D and a 0x0A. These are the hex codes for a CR, LF. Then send the intermediate file into your app.
HTH
Phil

We are drowning in data but starving for information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top