VERTICAL CSV MERGE · PRACTICAL GUIDE
How to merge CSV files vertically
CSV files with the same columns can be stacked into one file, which is useful for monthly or branch exports. This guide shows how to keep one header, preserve file order, and catch column mismatches before merging.
Stack matching CSV files into one output
When column names and positions match, you can keep the first file’s header and append every data row in order. LocaCSV merges 2–20 CSV files with a combined input size of up to 50 MiB into one CSV.
Try a vertical CSV merge
Reverse the file order to see the output rows move with it, or try a mismatched column order.
CSV files to merge
2 files
1july.csv
2 data rows
| Order ID | Store | Amount |
|---|---|---|
| A001 | London | 1200 |
| A002 | Madrid | 850 |
2august.csv
2 data rows
| Order ID | Store | Amount |
|---|---|---|
| A003 | London | 640 |
| A004 | Berlin | 2100 |
Merged result
4 output rows
merged.csv
One header row
| Order ID | Store | Amount |
|---|---|---|
| A001 | London | 1200 |
| A002 | Madrid | 850 |
| A003 | London | 640 |
| A004 | Berlin | 2100 |
When a vertical CSV merge is the right choice
A vertical merge is for files that describe the same fields. It adds rows, unlike a key-based join that adds columns from a related table.
- Consolidate monthly sales exports into a yearly file
- Combine identical branch or store reports for head office
- Reassemble CSV files exported in separate batches
- Reduce the number of files before the next processing step
Which CSV merge method should you use?
The best approach depends on whether this is a small one-off job or a task you will repeat. Keep the source files and choose a method that lets you check for missing or duplicated rows.
| Method | Best for | Advantage | Watch for |
|---|---|---|---|
| Excel | A few small CSV files | You can inspect data while copying it | Paste position, repeated headers, and worksheet row limits |
| Power Query | Repeated imports from one folder | A saved query can repeat the same steps | Automatic type conversion and rejected rows need review |
| Python | Scheduled or highly customized processing | Validation and output rules can be automated | Ongoing setup and upkeep are required |
| LocaCSV | CSV files totaling 50 MiB or less | Works in a browser and stops column mismatches first | Requires 2–20 files with matching names and column order |
Excel
- Best for
- A few small CSV files
- Advantage
- You can inspect data while copying it
- Watch for
- Paste position, repeated headers, and worksheet row limits
Power Query
- Best for
- Repeated imports from one folder
- Advantage
- A saved query can repeat the same steps
- Watch for
- Automatic type conversion and rejected rows need review
Python
- Best for
- Scheduled or highly customized processing
- Advantage
- Validation and output rules can be automated
- Watch for
- Ongoing setup and upkeep are required
LocaCSV
- Best for
- CSV files totaling 50 MiB or less
- Advantage
- Works in a browser and stops column mismatches first
- Watch for
- Requires 2–20 files with matching names and column order
Merge CSV files in four steps with LocaCSV
If a preview looks wrong, change that file’s input encoding or delimiter before merging.
- Open Vertical CSV merge and select 2–20 CSV files.
- Check each preview, encoding, delimiter, and column-match status.
- Move files up or down until they are in the required output order.
- Confirm the output settings, run the merge, and save the CSV after input and output row counts match.
File order becomes row order
Output rows follow the file list from top to bottom, and the row order inside each file is preserved. If july.csv is above august.csv, all July rows appear before August rows.
- The first file supplies the single output header
- Changing the order makes the new first file the header reference
- Arrange files before running when chronological order matters
Check headers and the 50 MiB limit
Every column name and position must match the first file exactly. A file with “Store,Amount” cannot be merged with “Amount,Store”, because that could place values under the wrong columns.
- Select between 2 and 20 files
- Combined input size must be 50 MiB or less
- The tool does not guess renamed, missing, or extra columns
- Before completion, total input data rows must equal output data rows
When encodings or delimiters differ
Inputs may mix UTF-8, Shift_JIS, and other supported encodings or delimiters. Review or change settings per file; the output uses one selected encoding and delimiter.
- Choose comma, semicolon, tab, or pipe separately for each input
- Output supports UTF-8 with or without BOM, Shift_JIS, ISO-8859-1, CP949, Big5, GB18030, and Windows-1252
- Characters unavailable in the output encoding stop the merge instead of being silently replaced