count
Counts the number of rows in a data file. With DuckDB engine, counting is instant for supported formats.
# Count rows in CSV file
undatum count data.csv
# Count rows in JSONL file
undatum count data.jsonl
# Use DuckDB engine for faster counting
undatum count data.parquet --engine duckdb
# Named Excel sheet
undatum count workbook.xlsx --table Sheet2
# Rows matching a SQL condition
undatum count data.csv --where "amount > 100"
# Machine-readable result (undatum.count/1)
undatum count data.csv --json
Reference
Reads: any readable format · Writes: a number · Memory: streaming · Engines: auto, duckdb, python
undatum count [OPTIONS] INPUT_FILE
| Argument | Description |
|---|---|
INPUT_FILE | Path to input file. (required) |
| Option | Description | Default |
|---|---|---|
-d, --delimiter TEXT | CSV delimiter character (auto-detected when omitted). | |
--quotechar TEXT | CSV quote character (iterabledata default '"' when omitted). | |
--encoding TEXT | File encoding (e.g., 'utf8', 'latin1'). | |
--verbose / --no-verbose | Enable verbose logging output. | --no-verbose |
-F, --format-in TEXT | Override file type detection (e.g., 'csv', 'jsonl'). | |
-e, --engine [auto|duckdb|python] | Processing engine: auto (default), duckdb, or python. | |
--table, --sheet TEXT | Table or sheet name for multi-table sources (Excel, SQLite, lakehouse). | |
--start-page INTEGER | Sheet index (0-based) for Excel files. | 0 |
--trust | Acknowledge pickle deserialization risk when reading pickle sources. | |
--on-error TEXT | Parse-error policy: raise (default), skip, or warn. | |
--error-log TEXT | Append parse errors as JSONL (use with --on-error skip or warn). | |
-O, --format-out TEXT | Output format: text (default) or json. | |
--json | Print the result as one JSON document (same as --format-out json). | |
--where TEXT | Keep records where this SQL condition is true (DuckDB syntax), e.g. "amount > 100 AND city = 'Berlin'". Text values are typed automatically. |
Deprecated spellings (removed in 2.0): --filetype → --format-in.
See also shared options.