Forrest logo
tool overview
On this page you find all important commands for the CLI tool csvsql. If the command you are looking for is missing please ask our AI.

csvsql

csvsql is a command line tool that allows users to run SQL queries on CSV files. It is designed to provide a convenient way to manipulate and analyze CSV data using familiar SQL syntax. The tool supports a wide range of SQL operations such as filtering, joining tables, grouping, aggregating, and more. It can be used to extract specific data from large CSV files, transform data, or perform complex data computations.

csvsql supports different SQL dialects, including SQLite, MySQL, PostgreSQL, and Firebird. Users can specify the SQL dialect using the --dialect option. The tool also provides various options to handle header processing, delimiter selection, and output formatting.

With csvsql, users can write SQL queries directly in the command line, execute them, and get the results in a new CSV file or print them to the terminal. The resulting CSV file can be easily imported into other applications or used for further analysis.

Overall, csvsql simplifies the process of working with CSV data by adding SQL functionality, allowing users to leverage their SQL knowledge effectively.

List of commands for csvsql:

  • csvsql:tldr:574b2 csvsql: Generate a `CREATE TABLE` SQL statement for a CSV file.
    $ csvsql ${path-to-data-csv}
    try on your machine
    explain this command
  • csvsql:tldr:5cfe8 csvsql: Run an SQL query on a CSV file.
    $ csvsql --query "${select * from 'data'}" ${data-csv}
    try on your machine
    explain this command
  • csvsql:tldr:de039 csvsql: Import a CSV file into an SQL database.
    $ csvsql --insert --db "${mysql:--user:password@host-database}" ${data-csv}
    try on your machine
    explain this command
tool overview