csv2sql is a script for importing CSV data into SQLite. It was created to allow CSV data to be manipulated via SQL queries.

For example, you can:

  1. Import a CSV file into an SQLite table:

    csv2sql -f products.csv

  2. Export the table that you just created to a CSV file sorted alphabetically by the value of the "ProductName" column:

    sqlite3 -header -csv csv2sql.db "SELECT * FROM products ORDER BY ProductName" > sorted-products.csv