diff options
author | Joop Kiefte <ikojba@gmail.com> | 2023-08-09 03:06:37 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2023-08-09 03:06:37 +0100 |
commit | aa38edcab665f7604e5f09b65d33156dbc78a3c2 (patch) | |
tree | 39df4c9fc6f4f761850185c0c157138000a88501 | |
parent | 1260bcaccaf7b9ab6716937cf18acb4475d72917 (diff) |
Add shellscripts for processing
-rw-r--r-- | import.bash | 9 | ||||
-rw-r--r-- | upload.bash | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/import.bash b/import.bash new file mode 100644 index 0000000..33e83b6 --- /dev/null +++ b/import.bash @@ -0,0 +1,9 @@ +#!/bin/bash + +export name=$1 + +dolt table rm $name +dolt schema import -c --pks id $name $name.csv --dry-run > /tmp/dolt_tmp_query.sql +$EDITOR /tmp/dolt_tmp_query.sql +dolt sql < /tmp/dolt_tmp_query.sql +dolt table import -u $name $name.csv diff --git a/upload.bash b/upload.bash new file mode 100644 index 0000000..59f067d --- /dev/null +++ b/upload.bash @@ -0,0 +1,6 @@ +#!/bin/bash + +rm *.txt *.csv +unzip $1 + +for file in *.txt; do mv $file ${file%.txt}.csv; echo $file; bash import.bash ${file%.txt} ; done |