csvkitHow to diff two CSV files using csvkit?
csvkit is a suite of command-line tools for working with CSV, the most popular being csvdiff
. It can be used to compare two CSV files and output the differences between them.
Example code
csvdiff file1.csv file2.csv
Output example
+---------+---------+---------+
| Column1 | Column2 | Column3 |
+---------+---------+---------+
| A | B | C |
| D | E | F |
+---------+---------+---------+
The code above will compare the two CSV files file1.csv
and file2.csv
and output the differences between them. The output will show the columns and the differences between the two files.
Code explanation
csvdiff
: This is the command used to compare two CSV files.file1.csv
andfile2.csv
: These are the two CSV files that will be compared.Column1
,Column2
,Column3
: These are the columns that will be compared.A
,B
,C
,D
,E
,F
: These are the values that will be compared.
Helpful links
More of Csvkit
- How to convert a tsv file to csv with csvkit?
- How to select specific columns with csvkit?
- How to fetch unique values with csvkit?
- How to reorder columns with csvkit?
- How to merge columns with csvkit?
- How to remove duplicates with csvkit?
- How to split a csv file with csvkit?
- How to remove columns with csvkit?
- How to rename a column with csvkit?
- How to update specific records using csvkit?
See more codes...