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 AColumn B
1A
2B
Column AColumn B
3C
4B
5B

...the following table is created:

Column AColumn B
1A
2B
3C
4B
5B

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)