csvkitHow to join two files with csvkit?
csvkit is a suite of command-line tools for working with CSV, the most popular being csvjoin
. It can be used to join two CSV files on a common field.
Example code
csvjoin -c common_field file1.csv file2.csv
Output example
common_field,field1,field2,field3
value1,value4,value5,value6
value2,value7,value8,value9
Code explanation
csvjoin
: the command to join two CSV files-c
: the flag to specify the common fieldcommon_field
: the name of the common fieldfile1.csv
: the first CSV filefile2.csv
: the second CSV file
Helpful links
More of Csvkit
- How to convert JSON to CSV using csvkit?
- How to merge columns with csvkit?
- How to remove duplicates with csvkit?
- How to update specific records using csvkit?
- How to convert a tsv file to csv with csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to select specific columns with csvkit?
- How to split a csv file with csvkit?
- How to fetch unique values with csvkit?
- How to reorder columns with csvkit?
See more codes...