Skip to main content

schema

The schema command infers the schema of a CSV file.

Syntax

qsv schema [options] <input_file> [<output_file>]

Description

The schema command is used to infer the schema of a CSV file. This is useful for understanding the structure and data types of a dataset.

Options

  • --no-headers: When set, the first row will not be interpreted as headers
  • --infer-types: Infer data types for each column

Examples

Infer Schema

Infer the schema of a CSV file:

qsv schema DLD_Transactions_English_500.csv

Infer Schema with Data Types

Infer the schema with data types for each column:

qsv schema --infer-types DLD_Transactions_English_500.csv

Common Use Cases

  • Understanding the structure of a dataset
  • Inferring data types for each column

Tips

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

See Also

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