[Tutor] CSV Module

orbitz orbitz at ezabel.com
Thu Aug 5 19:19:16 CEST 2004


I'm trying to use the csv module to read in a file nicley. My dialect 
looks like:

class TabSep(csv.Dialect):
  delimiter = '\t'
  quotechar = '"'
  escapechar = None
  doublequote = True
  skipinitialspace = True
  lineterminator = '\r\n'
  quoting = csv.QUOTE_MINIMAL

My problem is, while reading the file, one of the parts of it has a ^M 
on it so I get:

_csv.Error: newline inside string

Why is csv even complaining about this? I don't care what's in there, I 
tell it what to use as line terminator. Is there any way around this?


More information about the Tutor mailing list