sturdybits

Guides / Combine Sheets

How to merge multiple CSV files into one

30 November 2026

To merge CSV files that have the same columns, join them end to end: in the Windows Command Prompt, copy /b *.csv ..\combined.csv does it in one line. The catch is that every file's heading row comes along too, so remove the repeats afterwards or use a method that keeps only the first, such as PowerShell, Power Query or, on a Mac, a one-line awk command.

Put the files in a folder of their own before you start, and write the result somewhere else, so the merged file doesn't get swept up the next time you run the command.

1. The copy command (Windows)

Good for: files with identical columns, when you don't mind tidying the result.

  1. Open the folder in File Explorer, click the address bar, type cmd and press Enter. A Command Prompt opens in that folder.
  2. Type this and press Enter:
copy /b *.csv ..\combined.csv

The merged file appears in the folder above. Four things to know:

2. PowerShell (Windows)

Good for: files with the same headings, even in a different order.

Open the folder in File Explorer, type powershell in the address bar and press Enter, then run:

Get-ChildItem *.csv | ForEach-Object { Import-Csv $_.FullName } | Export-Csv ..\combined.csv -NoTypeInformation -Encoding UTF8

This reads each file as a table, so the result has one heading row, and columns are matched by heading, whatever their order. Two catches, both in Microsoft's Export-Csv documentation. The columns come from the first file, so a column that only appears in later files is left out. And Windows PowerShell 5.1, the version built into Windows, saves plain ASCII unless you add -Encoding UTF8: without it, é and £ turn into question marks. -NoTypeInformation stops it adding a #TYPE line at the top. For files separated by semicolons, add -Delimiter ';' after Import-Csv $_.FullName.

3. Terminal (Mac or Linux)

Good for: Mac users with files whose columns are in the same order.

In Terminal, go to the folder and run:

awk 'FNR == 1 && NR != 1 { next } { print }' *.csv > ../combined.csv

It prints the first file whole, then every other file without its first line, so you get one heading row. It also ends each file's last row properly, so rows don't run together. The simpler cat *.csv > ../combined.csv works too, but keeps every heading row.

4. Power Query (Excel for Windows)

Good for: regular merges, columns in a different order, and files with accented letters.

  1. Choose Data > Get Data > From File > From Folder, pick the folder and choose Open.
  2. Choose Combine > Combine & Transform Data.
  3. In Combine Files, check the preview. If letters look wrong, change File Origin to 65001: Unicode (UTF-8), and check the Delimiter is right.
  4. Choose OK, then Home > Close & Load.

You get one table with one heading row and a Source.Name column with each file's name, and Data > Refresh All picks up new files later. Power Query matches columns by heading but takes its list of columns from the sample file, and headings are case-sensitive, as our guide to combining Excel files explains.

Why £ and é turn into strange characters

A CSV file is text, and text can be saved in different encodings. Excel offers two kinds of CSV in Save As:

The same £ sign is stored differently in each. Merge a UTF-8 file with a Windows-1252 one and no single setting reads the result correctly: read one way, the UTF-8 rows show "£" and "é"; read the other, the older rows show a replacement symbol instead of the letter. PowerShell's Import-Csv has the same problem with the older files. Open them in Excel and save them as CSV UTF-8 before merging.

A UTF-8 file without the marker can also open wrongly when you double-click it. Microsoft's advice on opening CSV UTF-8 files is to import it with Data > From Text/CSV instead. There, File Origin sets the encoding.

When a tool is quicker

The copy and awk commands are quick but need the columns in the same order, and every method needs the encoding right before you start.

That's why we made Combine Sheets. Drop in the CSV files, or a folder of them, along with any Excel files. It works out whether each file uses commas, semicolons or tabs, keeps one heading row, and matches columns by heading whatever their order, ignoring capitals. A column that's only in some files gets its own column and is flagged rather than dropped, and every row is labelled with its file name. In the Excel download, plain numbers become numbers you can add up, while codes with leading zeros, such as 007, stay as typed. The CSV download is UTF-8 with the marker Excel looks for. It reads each file in its own encoding, whether it was saved as CSV UTF-8 or the older CSV (Comma delimited) on Windows, so £ signs and accented names come through, even when the files are a mix of both.

It runs in your browser, on Windows or Mac, and your files never leave your computer. The free version combines up to 10 files at a time; Pro is £19 once and combines any number. You can try it with sample files.

Quick answers

How do I merge CSV files without repeating the header? Use the awk command on a Mac, PowerShell's Import-Csv and Export-Csv on Windows, or Power Query, which all keep one heading row. With copy, delete the repeated heading rows afterwards.

Why does my merged CSV show  or é in places? "" is the UTF-8 marker from the start of a file, stranded mid-file by the merge. "é" means UTF-8 text is being read in the older encoding: open the file with Data > From Text/CSV and choose UTF-8.

Can I merge CSV files whose columns are in a different order? Not with copy, cat or awk, which join lines as they are. PowerShell and Power Query match columns by heading, within the limits above.