Skip to main content

input

The input command reads data from various sources and outputs it as a CSV file.

Syntax

qsv input [options] <source> [<output_file>]

Description

The input command is used to read data from various sources (e.g., databases, APIs) and output it as a CSV file. This is useful for integrating data from different systems.

Options

  • --no-headers: When set, the first row will not be interpreted as headers
  • --source-type <type>: Specify the source type (e.g., database, api)

Examples

Read from Database

Read data from a database and output it as a CSV file:

qsv input --source-type database --database-url "postgresql://user:password@host:port/dbname" --query "SELECT * FROM table_name" output.csv

Read from API

Read data from an API and output it as a CSV file:

qsv input --source-type api --api-url "https://api.example.com/data" output.csv

Common Use Cases

  • Integrating data from different systems
  • Reading data from external sources

Tips

  • Verify the output to ensure the data is correctly read
  • Use in combination with other commands for complex data processing

See Also

  • select - for selecting specific columns
  • apply - for data transformations