Skip to content

Instantly share code, notes, and snippets.

@Scarysize
Last active December 4, 2017 19:22
Show Gist options
  • Save Scarysize/bbf386404af8fa4e23d348044d6afc24 to your computer and use it in GitHub Desktop.
Save Scarysize/bbf386404af8fa4e23d348044d6afc24 to your computer and use it in GitHub Desktop.
-- enable CSV import mode
.mode csv
-- define the CSV separator
.separator ','
-- import & create tables, this will not insert the header line of a CSV file as a row
.import input/shapes.txt shapes
.import input/stops.txt stops
.import input/stop_times.txt stop_times
.import input/trips.txt trips
.import input/routes.txt routes
.import input/calendar.txt calendar
-- create a db file via:
-- $ sqlite3 gtfs.db < import.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment