blob: 1b493cf05866824136755e72b0a6c0a479b15340 (
plain) (
tree)
|
|
#!/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
sqlite3 airq.db <<EOF
.mode csv
.import export.csv air
SELECT * FROM air;
.exit
EOF
|