summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--import.bash9
-rw-r--r--upload.bash6
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