Revision 5429
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/csvs.py | ||
---|---|---|
68 | 68 |
# Prevent "new-line character seen in unquoted field" errors |
69 | 69 |
record = record.replace('\r', ending_placeholder) |
70 | 70 |
|
71 |
row = csv.reader(StringIO.StringIO(record), self.dialect).next()
|
|
71 |
row = record.split(self.dialect.delimiter)
|
|
72 | 72 |
return [strings.replace_all(tsv_decode_map, v) for v in row] |
73 | 73 |
|
74 | 74 |
def reader_class(dialect): |
Also available in: Unified diff
csvs.py: TsvReader: Use str.split() instead of csv.reader().next() to parse the row, for efficiency and to support multi-char delimiters. This is possible because the TSV dialect doesn't use CSV parsing features other than the delimiter and newline-escaping (which is handled separately).