Project

General

Profile

« Previous | Next » 

Revision 1389

bin/map: Use new csvs.reader_and_header() to support CSVs/TSVs with other than the default Excel dialect

View differences:

bin/map
11 11

  
12 12
sys.path.append(os.path.dirname(__file__)+"/../lib")
13 13

  
14
import csvs
14 15
import exc
15 16
import opts
16 17
import Parser
......
195 196
            row_ct = map_rows(get_value, rows)
196 197
        else: # input is CSV
197 198
            map_ = dict(mappings)
198
            reader = csv.reader(sys.stdin)
199
            col_names = reader.next()
199
            reader, col_names = csvs.reader_and_header(sys.stdin)
200 200
            col_idxs = util.list_flip(col_names)
201 201
            
202 202
            mappings_new = []

Also available in: Unified diff