Revision 5146
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/csvs.py | ||
---|---|---|
36 | 36 |
else: info.dialect = None # line of '' indicates EOF = empty stream |
37 | 37 |
return info |
38 | 38 |
|
39 |
tsv_encode_map = [ |
|
40 |
('\t', r'\t'), |
|
41 |
('\n', '\\\n'), |
|
42 |
] |
|
43 |
|
|
39 | 44 |
class TsvReader: |
40 | 45 |
'''Unlike csv.reader, for TSVs, interprets \ as escaping a line ending but |
41 | 46 |
ignores it before everything else (e.g. \N for NULL). |
Also available in: Unified diff
csvs.py: Added tsv_encode_map for use in creating TSVs parsed by TsvReader