Skip to content

Instantly share code, notes, and snippets.

@marklit
Created May 18, 2016 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklit/33d72b56e91ba83954914ec6e7a9615b to your computer and use it in GitHub Desktop.
Save marklit/33d72b56e91ba83954914ec6e7a9615b to your computer and use it in GitHub Desktop.
Insert compressed CSV data into an SQLite3 table
$ (echo -e "PRAGMA synchronous=OFF; PRAGMA count_changes=OFF;\n.mode csv\n.separator ,\n.import /dev/stdin trips";
gunzip -c ~/taxi-data/*.csv.gz) | \
sqlite3 trips.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment