From 217b86ebc9a12d118d8fdc20507a0f2381750c09 Mon Sep 17 00:00:00 2001 From: elioat <{ID}+{username}@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:31:30 -0400 Subject: * --- py/air-quality/convert-csv-2-sqlite.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 py/air-quality/convert-csv-2-sqlite.sh (limited to 'py') diff --git a/py/air-quality/convert-csv-2-sqlite.sh b/py/air-quality/convert-csv-2-sqlite.sh new file mode 100755 index 0000000..13c98cc --- /dev/null +++ b/py/air-quality/convert-csv-2-sqlite.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Convert CSV to SQLite + +# check for input file, abort if it is missing +if [ ! -f export.csv ]; then + echo "export.csv not found!" + exit 1 +fi + +# check for sqlite3 database, if it exists, +# delete it so we can make a new one +if [ -f airq.db ]; then + rm airq.db +fi + +# create a new sqlite3 database +# import the CSV file into the database +# display the contents of the database +# exit sqlite3 + +# make this work in a bash script + +sqlite3 airq.db <