The following single command line works in both
cmd.exe (version 10.0.x.x via ver) and
powershell.exe (version 5.1.x.x via $PSVersionTable)
.\sqlite3.exe my.db ".import file1.csv table1 --csv"
This loads the contents of csv file file1.csv into table table1 within the sqlite database file my.db. The --csv flag will import the file and create the table structure based on the header column names in that file, and will approximately infer the data types.
You can import multiple files this way.
i.e.
.\sqlite3.exe my.db ".import file1.csv table1 --csv" ".import file2.csv table2 --csv"
You can chain commands together to immediately open the database for querying by appending ; .\sqlite3.exe my.db.
i.e.
.\sqlite3.exe my.db ".import file1.csv table1 --csv" ".import file2.csv table2 --csv; .\sqlite3.exe my.db"
echo(which is really an alias forWrite-Output) in PowerShell; try".import export.csv mytable" | sqlite3.exe.sqlite3 yourdatabase.db < ".import export.csv mytable"The '<' operator is reserved for future use.