csvstack and one filename
Created by: yn
I like to use csvstack from a shell script like this:
for d in results/*; do
t=$(basename $d)
psql -c "drop table $t;"
csvstack results/$t/* | csvsql --insert --db "postgresql://localhost" --no-inference --no-constraints --tables $t
done
if there's only one CSV file in a subdirectory of results/ then csvstack errors out. Can CSVstack do something "default" like just echo the input file instead of erroring out? I am happy to submit a PR if you guys think this feature would be accepted.