Supported Input Formats & Key Paths

Parsing rules for delimited text tables and newline-delimited JSON objects.

CSV and TSV Delimited Tables

CSV files must use RFC 4180 double-quote escaping with UTF-8 encoding (leading UTF-8 BOM bytes are stripped cleanly). Tab-separated inputs are selected automatically for .tsv extensions or explicitly with --input-format tsv. Duplicate header names fail early with exit code 2.

JSONL (Newline-Delimited JSON)

Each non-empty line must parse into a single JSON object. Nested properties can be targeted as keys or ignored columns using dot notation such as --key meta.record_id. Array ordering is treated as significant unless --unordered-lists is supplied on the command line.

$ drift compare prev.jsonl next.jsonl --key meta.record_id --ignore metrics.elapsed_ms

Handling Empty vs. Null Cells

In CSV mode, an empty cell compares equal to an omitted JSON key when comparing cross-format snapshots if --empty-as-null is active; otherwise empty strings and explicit null literals remain distinct values.