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 fetch unique values with csvkit?
- How to split a csv file with csvkit?
- How to remove duplicates with csvkit?
- How to install csvkit on a Mac?
- How to update specific records using csvkit?
- How to convert a tsv file to csv with csvkit?
- How to merge columns with csvkit?
- How to skip the first line with csvkit?
- How to remove columns with csvkit?
See more codes...