Merge CSV files
Merge CSV files
Description
Merge multiple CSV files. All input files must have the same header.
Input files
- at least 1 input file (.csv)
Output files
- Merged entries (merged.csv)
Context
Example
Using the following tables as input:
Column A | Column B |
---|---|
1 | A |
2 | B |
Column A | Column B |
---|---|
3 | C |
4 | B |
5 | B |
...the following table is created:
Column A | Column B |
---|---|
1 | A |
2 | B |
3 | C |
4 | B |
5 | B |
Common CSV file problems
CSV files must be plain text files, using , as the entry separator, and " as the optional quote character. The quote character is used to denote a cell if the entry separator is part of the cell content. The first line is expected to represent the table header, all following lines are expected to represent table rows.
Source code
merge-csv-files.rb, merge-csv-files.yaml (GitHub)