A
Alex van der Spek
I have a text file that uses both '\r' and '\r\n' end-of-line terminations.
The '\r' terminates the first 25 lines or so, the remainder is termiated
with '\r\n'
Reading this file like this:
++++++++
for line in open(filename,'r'):
line= #Do whatever needs doing...
++++++++
The first line read is actually a string consiting of the first 25 lines.
The readline() method does the same thing.
Is there a way to make it read one line at a time, regardless of the line
termination?
By the way, the newlines attribute reports None after reading a few lines. I
tried on Linux and Windows. I use the standard binaries as distributed.
Thanks in advance,
Alex van der Spek
The '\r' terminates the first 25 lines or so, the remainder is termiated
with '\r\n'
Reading this file like this:
++++++++
for line in open(filename,'r'):
line= #Do whatever needs doing...
++++++++
The first line read is actually a string consiting of the first 25 lines.
The readline() method does the same thing.
Is there a way to make it read one line at a time, regardless of the line
termination?
By the way, the newlines attribute reports None after reading a few lines. I
tried on Linux and Windows. I use the standard binaries as distributed.
Thanks in advance,
Alex van der Spek