Created
October 6, 2017 20:42
-
-
Save juanpampliega/c63f82861a8acf54e1aec7b719fd7d9a to your computer and use it in GitHub Desktop.
Convert a csv file to a sqlite db file to enable easy querying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function csv2db() { | |
echo -e ".mode csv \n.import $1.csv $1" | sqlite3 $1.db && \ | |
sqlite3 -header -column $1.db | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment