Project

General

Profile

« Previous | Next » 

Revision 1451

input.Makefile: Mapping: Support multiple segments of a source table flat file. Use with_cat_csv if flat file segment(s) are available; otherwise use the input file in $+ or the input database, if any. Don't look for an explicit CSV header file because it can now be handled as the first segment if appropriately named.

View differences:

input.Makefile
135 135
inputFiles := $(wildcard $(exts:%=src/*.%))
136 136

  
137 137
+maps = $(filter maps/% $(mappings)/%,$(+_))
138
<in = $(firstword $(filter-out $(+maps),$(+_)) $(wildcard $(exts:%=src/*.$*.%)))
139
inputs = $(strip $(wildcard $(<in).header) $(<in))
140
map = $(if $(inputs),$(bin)/with_cat $(inputs) -- ,$(if $(mapEnv),env $(mapEnv)\
141
,$(error No input file src/*.$*.{$(exts)})))$(root)/map $(+maps)
138
<in = $(firstword $(filter-out $(+maps),$(+_)))
139
srcs = $(sort $(wildcard $(exts:%=src/*.$*.%)))
140
map = $(if $(<in),<$(<in),\
141
$(if $(srcs),$(bin)/with_cat_csv $(srcs) --,\
142
$(if $(mapEnv),env $(mapEnv),\
143
$(error No input file src/*.$*.{$(exts)}))))\
144
$(root)/map $(+maps)
142 145
map2db = env out_database=vegbien $(map)
143 146

  
144 147
##### Import to VegBIEN

Also available in: Unified diff