Project

General

Profile

« Previous | Next » 

Revision 3924

join: Added map_1_core_only option that uses only columns 0 and 1 of map_1. This is useful for one-time refactoring joins where the Source column, mappings comments, etc. shouldn't be part of the datasource's via map (although they will be part of the autogenerated VegBIEN map)

View differences:

join
22 22
            +sys.argv[0]+' <map_0 map_1 [| '+sys.argv[0]+' map_2]... >out_map')
23 23
    
24 24
    only_one = opts.env_flag('only_one', False, env_names)
25
    # Uses only columns 0 and 1 of map_1
26
    map_1_core_only = opts.env_flag('map_1_core_only', False, env_names)
25 27
    # Turns off "No input mapping" errors
26 28
    quiet = opts.env_flag('quiet', False, env_names)
27 29
    try: _prog_name, map_1_path = sys.argv
......
33 35
    reader = csv.reader(stream)
34 36
    map_1_cols = reader.next()
35 37
    for row in reader:
38
        if map_1_core_only: row = row[:2]
36 39
        if row[0] != '': map_1.setdefault(row[0], []).append(row)
37 40
    stream.close()
38 41
    

Also available in: Unified diff