Project

General

Profile

« Previous | Next » 

Revision 7211

csvs.py: TsvReader: Use csv.reader.next() when possible to support quoted fields, such as in Madidi.IndividualObservation

View differences:

csvs.py
87 87
        # Prevent "new-line character seen in unquoted field" errors
88 88
        record = record.replace('\r', ending_placeholder)
89 89
        
90
        row = record.split(self.dialect.delimiter)
90
        # Split line
91
        if len(self.dialect.delimiter) > 1: # multi-char delims
92
            row = record.split(self.dialect.delimiter)
93
        else: row = csv.reader(StringIO.StringIO(record), self.dialect).next()
94
        
91 95
        return [strings.replace_all(tsv_decode_map, v) for v in row]
92 96

  
93 97
def reader_class(dialect):

Also available in: Unified diff