SQLite - How to import a CSV file into SQLite table?
Using SQLite command-line tool
Run this command to specify the csv file type and table
sqlite> .mode csv table_name
sqlite> .import file_name.csv table_name
If it’s a SQL file, you can import it by this command:
sqlite> .read file_name.sql
Using TablePlus GUI tool
You can import a CSV file directly into SQLite table from its table view:
-
Open the destination table to view then choose
File
->Import CSV
from the menu. -
Or you can right-click on the table name from the right panel (or even any data cell of the table), choose
Import CSV
.
Then specify how you would like to import data.
New to TablePlus? It’s a GUI client for multiple relational databases. It’s native, beautiful, and available for free.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS