csvkitHow to merge multiple files with csvkit?
csvkit is a suite of command-line tools for working with CSV, the most popular being csvstack
. csvstack
can be used to merge multiple CSV files into a single file.
Example code
csvstack file1.csv file2.csv file3.csv > merged.csv
Output example
Merged file saved as merged.csv
Code explanation
csvstack
: the command used to merge multiple CSV filesfile1.csv
,file2.csv
,file3.csv
: the files to be merged>
: the output operator, used to save the merged file asmerged.csv
Helpful links
More of Csvkit
- How to skip the first line with csvkit?
- How to select specific columns with csvkit?
- How to fetch unique values with csvkit?
- How to merge columns with csvkit?
- How to convert a tsv file to csv with csvkit?
- How to change the encoding in csvkit?
- How to split a csv file with csvkit?
- How to remove duplicates with csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to sort a csv file with csvkit?
See more codes...