Note: The other languages of the website are Google-translated. Back to English

How to merge multiple CSV files into one Excel file with CMD command?

Sometimes, we may need to sort and combine all related CSV files into one Excel file. Using the CMD command, we can achieve the goal in a rather quick and easy way. Different from the complicated built-in Power Query tool in Excel, the CMD command method runs independently of Excel and is easy to operate. In this tutorial, we will introduce the way to merge multiple CSV files into one Excel file with CMD command.
doc merge-multiple-csv-files-into-one-excel-file-cmd 1

Merge multiple CSV files into one Excel file with CMD command


To accomplish the merging of multiple related CSV files, please do as follows.

1. Move all the CSV files that you want to merge into one workbook to one folder.
doc merge-multiple-csv-files-into-one-excel-file-cmd 2

2. Locate the target folder on File Explore, and go to the Home tab, then click Copy path.
doc merge-multiple-csv-files-into-one-excel-file-cmd 3

Note: The Copy path button on File Explorer’s Home tab is available on Windows 10 and higher versions. For users of lower versions of Windows, just select the folder, press the Shift key and right-click the folder, then click Copy as path in the menu list.
doc merge-multiple-csv-files-into-one-excel-file-cmd 4

3. Go to the Windows search box, type cmd, then click the Open button to start the Command Prompt app.
doc merge-multiple-csv-files-into-one-excel-file-cmd 5

4. In the Command Prompt window, enter the command cd to change the active directory to the CSV folder. Then enter a space, and press Ctrl + V to paste the folder path. Or you can drag and put the folder directly from File Explorer in the Command Prompt window.
doc merge-multiple-csv-files-into-one-excel-file-cmd 6

5. Press the Enter key to run the command. Then the folder path will appear on the command line, reflecting the active directory change.
doc merge-multiple-csv-files-into-one-excel-file-cmd 7

6. Continue to type copy *.csv merged-csv-files.csv in the command line. Then press Enter.
doc merge-multiple-csv-files-into-one-excel-file-cmd 8

The names of all CSV files in the target folder are displayed below the executed command.

7. Go back to the folder which contains the original CSV files. You will see a new file named merged-csv-files.csv.
doc merge-multiple-csv-files-into-one-excel-file-cmd 9

Open the result file, you will see all data in the original csv files are merged into one Excel File.


Other Operations (Articles)

How To Quickly Insert A Line Based On Current Date In Excel?
Supposing there is a sheet containing a row with dates, and now I want to insert a line right to the current date which will auto change while opening the workbook every day. Is there a trick can solve it in Excel?

How To Always Insert A Blank Row Below Instead Of Above In Excel?
As we all known, when inserting blank row in a worksheet, the blank row will always be inserted above the selected row or cell. But, sometimes, you may need to insert the row below the selected cell or row. How could you solve this job in Excel?

How To Insert A Blank New Row Automatically By Command Button In Excel?
In many cases, you may need to insert a blank new row into a specified position of your worksheet. In this article, we will show you how to insert a blank new row automatically by clicking on a Command Button in Excel.

How To Insert A Blank Row After Specific Text In Excel?
If you want to insert blank rows after a specific text as following screenshot shown, how to deal with it quickly and easily without inserting them manually one by one?


  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL