Skip to main content

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
ArgumentDescription
INPUT_FILEPath to input file. (required)
OptionDescriptionDefault
-d, --delimiter TEXTCSV delimiter character (auto-detected when omitted).
--quotechar TEXTCSV quote character (iterabledata default '"' when omitted).
--encoding TEXTFile encoding (e.g., 'utf8', 'latin1').
--verbose / --no-verboseEnable verbose logging output.--no-verbose
-F, --format-in TEXTOverride file type detection (e.g., 'csv', 'jsonl').
-e, --engine [auto|duckdb|python]Processing engine: auto (default), duckdb, or python.
--table, --sheet TEXTTable or sheet name for multi-table sources (Excel, SQLite, lakehouse).
--start-page INTEGERSheet index (0-based) for Excel files.0
--trustAcknowledge pickle deserialization risk when reading pickle sources.
--on-error TEXTParse-error policy: raise (default), skip, or warn.
--error-log TEXTAppend parse errors as JSONL (use with --on-error skip or warn).
-O, --format-out TEXTOutput format: text (default) or json.
--jsonPrint the result as one JSON document (same as --format-out json).
--where TEXTKeep 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.