← 返回命令列表

Linux command

csv-diff 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Diff two CSV files

csv-diff [old.csv] [new.csv]

Diff with specific key column

csv-diff [old.csv] [new.csv] --key [id]

Output as JSON

csv-diff [old.csv] [new.csv] --json

Show only changes

csv-diff [old.csv] [new.csv] --show-unchanged

说明

csv-diff compares two CSV, TSV, or JSON files and shows added, removed, and changed rows. It's useful for tracking changes in data exports, database dumps, or any tabular data. A --key column must be specified so rows can be matched across files. Output is human-readable by default, and machine-readable JSON is available via --json. The tool is a standalone Python package by Simon Willison, installable via `pip install csv-diff`. It is distinct from csvkit.

参数

--key _column_
Column to use as unique identifier.
--json
Output in JSON format.
--show-unchanged
Include unchanged rows in output.
--singular _name_
Singular noun for rows.
--plural _name_
Plural noun for rows.

FAQ

What is the csv-diff command used for?

csv-diff compares two CSV, TSV, or JSON files and shows added, removed, and changed rows. It's useful for tracking changes in data exports, database dumps, or any tabular data. A --key column must be specified so rows can be matched across files. Output is human-readable by default, and machine-readable JSON is available via --json. The tool is a standalone Python package by Simon Willison, installable via `pip install csv-diff`. It is distinct from csvkit.

How do I run a basic csv-diff example?

Run `csv-diff [old.csv] [new.csv]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --key _column_ do in csv-diff?

Column to use as unique identifier.