On 12/13/2016 08:45 AM, George Trojan - NOAA Federal wrote:
Ideally I'd like to have code that handles both '\r\r\n' and '\n' as the
split character.

George

Are repeated newlines/carriage returns significant at all? What about just using re and just replacing any repeated instances of '\r' or '\n' with '\n'? I.e. something like

>>> # the_string is your file all read in
>>> import re
>>> re.sub("[\r\n]+", "\n", the_string)

and then continuing as before (i.e. splitting by newlines, etc.)

Does that work?

Cheers,
Thomas
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to