How to Merge CSV Files Into One File in Windows

To merge CSV files into one file in Windows 11, put them all in one folder, open Command Prompt in that folder, and run copy /b *.csv combined.txt. Then rename combined.txt to combined.csv. Windows joins every CSV into a single file. If each file has its own header row, use the PowerShell or Excel method below so the headers aren’t repeated.

In this guide:

Method 1: The copy command (fastest)

Microsoft’s documentation for the copy command explains that when you list several source files and one destination, copy combines them into that single file.

  1. Put all the CSV files you want to merge in one folder, with nothing else in it.
  2. Open that folder in File Explorer, click the address bar, type cmd, and press Enter. Command Prompt opens in that folder.
  3. Type copy /b *.csv combined.txt and press Enter.
  4. Rename combined.txt to combined.csv.

The /b switch copies each file exactly as it is. Saving to a .txt name first keeps the new file from being picked up by *.csv while the command runs.

Heads-up: this method keeps every file’s header row, so you’ll see the column names repeated wherever one file ends and the next begins. Delete those extra rows in Excel, or use Method 2.

Steps to merge CSV files with Command Prompt: put the CSVs in one folder, open Command Prompt there, run copy /b *.csv combined.txt, and rename the result to combined.csv
The copy command joins every CSV in a folder into one file.

Result: You get one combined.csv with every row from every file.

After combining the files, you can make CSV files open in Excel by default for easier inspection. Review duplicate headers and preserve identifiers with Excel’s import controls before saving; the default-app choice alone does not validate the combined data.

Method 2: PowerShell (removes duplicate headers)

If every file has the same column headers, PowerShell can read them as data and write one clean file. It uses the Import-Csv and Export-Csv commands.

  1. Open the folder, click the address bar, type powershell, and press Enter.
  2. Run this command:
    Get-ChildItem *.csv | ForEach-Object { Import-Csv $_.FullName } | Export-Csv ..\combined.csv -NoTypeInformation
  3. Find combined.csv in the folder one level up.

The files need matching column names. Columns that don’t match end up empty in the combined file.

Result: One clean file with a single header row, ready to open in Excel or import elsewhere.

Method 3: Excel Power Query (no commands)

  1. In Excel, go to Data › Get Data › From File › From Folder.
  2. Choose the folder with your CSV files and select Open.
  3. Select Combine › Combine & Load.
  4. Pick the first file as the example, then select OK.

Microsoft explains this in Import data from a folder with multiple files. Power Query uses the headers once and refreshes if you add more files later.

In the Combine Files dialog, Microsoft notes you can set the File Origin, Delimiter and Data Type Detection, and choose Skip files with errors so one bad file doesn’t stop the import.

Steps to merge CSV files in Excel with Power Query: Data, Get Data, From File, From Folder, pick the folder, Combine and Load, then OK
Power Query combines a folder of CSV files without any commands.

Result: Excel creates a single table from all the files, which you can save as a new CSV or workbook.

Which method should you use?

  • copy: fastest, works for any number of files, but repeats headers.
  • PowerShell: one clean file when all headers match.
  • Excel: easiest if you don’t like commands, and you can clean the data before saving.

Frequently Asked Questions

Will merging change my original CSV files?

No. All three methods read the files and write a new combined file, leaving the originals as they were.

What if my files use semicolons instead of commas?

Use the Excel method and set the Delimiter in the Combine Files dialog.

How do I make CSV files open in Excel?

See how to open CSV files with Excel by default.

New to the command line? See how to open Command Prompt in Windows 11.

Combining contact lists? Once they’re in one file, see how to import contacts to Gmail from a CSV file. Google asks you to keep each import to 3,000 contacts or fewer.

Join Our Free Newsletter

Featured guides and deals

You may opt out at any time.
Read our Privacy Policy