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.

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.

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.

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.

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.

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

Join Our Free Newsletter

Featured guides and deals

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