Revision 3569
Added by Aaron Marcuse-Kubitza over 12 years ago
src_map | ||
---|---|---|
19 | 19 |
|
20 | 20 |
# Get config from env vars |
21 | 21 |
datasrc = opts.get_env_var('datasrc', None, env_names) |
22 |
if datasrc == None: usage_err() |
|
22 |
out_root = opts.get_env_var('out_root', None, env_names) |
|
23 |
in_root_suffix = opts.get_env_var('in_root_suffix', '', env_names) |
|
24 |
if datasrc == None or out_root == None: usage_err() |
|
23 | 25 |
|
24 | 26 |
# Get col names |
25 | 27 |
reader, col_names = csvs.reader_and_header(sys.stdin) |
26 | 28 |
|
27 | 29 |
# Write map spreadsheet |
28 | 30 |
writer = csv.writer(sys.stdout) |
29 |
writer.writerow([datasrc]) |
|
31 |
writer.writerow([datasrc+in_root_suffix, out_root, 'Comments'])
|
|
30 | 32 |
for col_name in col_names: |
31 | 33 |
writer.writerow([col_name]) |
32 | 34 |
|
Also available in: Unified diff
src_map: Also add columns for the output mappings and comments, so that the src map can be directly copied for use as the via map (DwC.specimens.csv, etc.). The output mapping column name must be provided by the caller, which input.Makefile maps/src.%.csv provides using the new mappings roots.