csvkitHow to merge columns with csvkit?
csvkit is a suite of command-line tools for working with CSV files. It can be used to merge columns from multiple CSV files into a single file.
Example code
csvstack -n 1,2,3 file1.csv file2.csv > merged.csv
Output example
1,2,3
a,b,c
d,e,f
g,h,i
Code explanation
csvstack
: the command to merge columns from multiple CSV files-n 1,2,3
: the option to specify which columns to mergefile1.csv
andfile2.csv
: the two files to be merged> merged.csv
: the output file
Helpful links
More of Csvkit
- How to convert a tsv file to csv with csvkit?
- How to fetch unique values with csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to skip the first line with csvkit?
- How to update specific records using csvkit?
- How to select specific columns with csvkit?
- How to split a csv file with csvkit?
- How to reorder columns with csvkit?
- How to rename a column with csvkit?
- How to install csvkit on a Mac?
See more codes...