in2csv
converts tabular data from various formats to CSV
TLDR
SYNOPSIS
in2csv [options] [file]
DESCRIPTION
in2csv converts tabular data from various formats to CSV. It's part of the csvkit toolkit for working with CSV files.The tool handles Excel (XLS, XLSX), JSON, newline-delimited JSON, GeoJSON, DBF, fixed-width and CSV input. Run on a CSV file, it standardizes quoting and line endings. The output can be piped to other csvkit tools for analysis.
PARAMETERS
-f, --format FORMAT
Input format: csv, dbf, fixed, geojson, json, ndjson, xls, xlsx. Inferred from the file extension if omitted.-s, --schema SCHEMA
CSV schema file (column,start,length) for fixed-width input.-k, --key KEY
Top-level JSON key containing the list of objects to convert.-n, --names
Display sheet names from the Excel file.--sheet NAME
Excel sheet to convert.--write-sheets NAMES
Comma-separated sheet names (or - for all) to write to separate files.--use-sheet-names
Name files after sheets when using --write-sheets.--encoding-xls ENCODING
Encoding of the input XLS file.-e, --encoding ENCODING
Encoding of the input file.-H, --no-header-row
Input has no header row; columns are named a, b, c...-K, --skip-lines N
Skip N lines at the start of the input.-I, --no-inference
Disable type inference when parsing CSV input.-y, --snifflimit BYTES
Limit CSV dialect sniffing; 0 disables it, -1 sniffs the whole file.-h, --help
Display help information.
CAVEATS
Part of csvkit (Python). Large files may be slow. When reading from stdin, -f is required. Numbers from XLS files may gain decimals that the equivalent XLSX would not have. Unnamed header columns are given generated names.
HISTORY
in2csv is part of csvkit, created by Christopher Groskopf in 2011 for journalists and data analysts, and now maintained by the wireservice organization.
