Re: CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread Peter Otten
Tino Lange wrote: >>> I'm trying to use the csv Parser included with Python. Field Delimiter >>> is "|", Line Delimiter is "#". Unfortunately it doesn't work as >>> expected. The parser seems to just ignore the 'lineterminator'? >> >> The csv reader accepts '\r' '\r\n' or '\n' as line endings, ev

Re: CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread skip
Tino> Is this going to be changed? Is someone working on it? Or are Tino> patches for SF wanted? A patch that removes this constraint would be helpful. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread Tino Lange
Peter Otten wrote: > Tino Lange wrote: > >> I'm trying to use the csv Parser included with Python. Field Delimiter is >> "|", Line Delimiter is "#". Unfortunately it doesn't work as expected. >> The parser seems to just ignore the 'lineterminator'? > > The csv reader accepts '\r' '\r\n' or '\n'

Re: CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread Peter Otten
Peter Otten wrote: > memfile = (s + "\n" for s in "1a|1b|1c|1d#2a|2b|2c|2d#3a|3b|3c > 3d#".split("#") if s) I just found out that you need not add "\n" to the line. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread Peter Otten
Tino Lange wrote: > I'm trying to use the csv Parser included with Python. Field Delimiter is > "|", Line Delimiter is "#". Unfortunately it doesn't work as expected. The > parser seems to just ignore the 'lineterminator'? The csv reader accepts '\r' '\r\n' or '\n' as line endings, even mixed in

CSV Parser and unusual (?) linesterminator - misunderstanding?

2006-01-20 Thread Tino Lange
Hi! I'm trying to use the csv Parser included with Python. Field Delimiter is "|", Line Delimiter is "#". Unfortunately it doesn't work as expected. The parser seems to just ignore the 'lineterminator'? Here's some example: > $ cat test.py > #! /usr/bin/env python > > import sys, csv, cStringIO