sqlite3 app.db '.import users.csv users'

Category: Databases & SQL

sqlite3 app.db '.import users.csv users'

Load a CSV file into a table

Reads users.csv and inserts its rows into the users table, which must already exist; sqlite auto-detects CSV quoting. Run .mode csv first if parsing misbehaves. Related: .output with .dump for the reverse.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.