Skip to content

Instantly share code, notes, and snippets.

@juanpampliega
Created October 6, 2017 20:42
Show Gist options
  • Save juanpampliega/c63f82861a8acf54e1aec7b719fd7d9a to your computer and use it in GitHub Desktop.
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
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