Disclosure: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

How to Merge Excel Files into One Using CMD (4 Steps)

If you are looking for ways to merge Excel files into one using CMD, then you are in the right place. Sometimes you may need to combine data from various Excel files into one and to do this quickly you just need to apply some command lines in CMD or Command Prompt.
So, let’s start with the main article.

Download Workbook





4 Steps to Merge Excel Files into One Using CMD

Here, we have the following three files January.xlsx, February.xlsx, and March.xlsx containing the sales records for the January, February, and March months of a company. In the following, we have explained 4 steps to merge these files into one Excel file using CMD.

how to merge Excel files into one using CMD

how to merge Excel files into one using CMD

how to merge Excel files into one using CMD

We have used Microsoft Excel 365 version here, you can use any other versions according to your convenience.


Step-01: Saving Excel Files as CSV Format in a Folder

The first step for merging multiple Excel files into one is to convert the XLSX files into CSV files.
➤ Go to the File Tab.

saving Excel files

➤ Now, select the Save As option and then click on the dropdown symbol beside the Save Option.

saving Excel files

Then, you will see different types of file formats in the list, explore them and choose the option CSV UTF-8 (Comma delimited) from the list of other formats.
➤ In addition to this, change the file name from January to 1-January (the serial numbers preceding the file name will arrange the files serially according to which serial we want to merge them).
➤ Finally, click on the Save option.

saving Excel files

Then, we will have our new file name with the new format as 1-January.csv.

saving Excel files

Similarly, we will change the file formats for the other two files also.
➤ For February.xlsx file select the option CSV UTF-8 (Comma delimited) from the list of other formats, change the name into 2-February, and click on Save.

saving Excel files

After that, you will get the new filename 2-February.csv instead of February.xlsx.

saving Excel files

➤ To change the format of the March.xlsx file select the option CSV UTF-8 (Comma delimited) from the list of other formats, change the name into 3-March, and click on Save.

saving Excel files

Finally, you will get the new filename 3-March.csv.

saving Excel files

Then, we have gathered them in a folder named Multiple Files where they are arranged serially. Later we will need the path to go to the folder Multiple Files.

how to merge Excel files into one using CMD

Read More: How to Merge Excel File into Word Document


Step-02: Opening CMD or Command Prompt to Merge Excel Files into One

In this step, we will open the CMD or Command Prompt to merge the multiple Excel files into one using this CMD.
➤ Press the WINDOWS key + R and then you will have the Run wizard.

opening CMD window

➤ Type cmd in the Open box and then press OK to run the command prompt.

opening CMD window

As you can see, we have opened the CMD or Command Prompt.

opening CMD window

Read More: How to Merge Multiple Excel Files into One Sheet (4 Methods)


Step-03: Using Some Commands to Merge Excel Files into One Using CMD

Now, we will type some commands with the command-line interface in this section in the Command Prompt to merge our desired files.

Firstly, we will need to copy the path of the folder Multiple Files in which we have stored our Excel files in CSV format to be merged.
➤ To have the Copy path option, you have to expand the ribbon by clicking on the dropdown symbol in the top right corner or pressing CTRL+F1.

using some commands

In this way, you will be able to expand the ribbon.
➤ Select the folder Multiple Files and then click on the Copy path option.

using some commands

Now, get back to the Command Prompt window, and here we will have to change the active directory to go to the path of our folder Multiple Files.
➤ Type cd and provide space after it.

using some commands

➤ Press CTRL+V or Right-Click on your mouse to paste the copied path of our Multiple Files folder

using some commands

After pressing ENTER, you will be taken to the directory that we have provided in the previous line.

using some commands

➤ Now, type copy *.csv combined.csv (where combined is our new filename) followed by in the new line.

using some commands

After pressing ENTER, the following indicated command lines will be automatically generated where we can see the three file names which we want to merge.

using some commands

After closing the CMD window, go to the folder Multiple Files where you will have the new merged file named combined.csv.

how to merge Excel files into one using CMD

Read More: How to Merge Multiple Excel Files into One Sheet by VBA (3 Criteria)


Step-04: Opening New Created File and Save in XLSX Format

In the previous step, we created a new file combined.csv to merge all of the three files in the Multiple Files folder. Here, we will change the format of this file from CSV to XLSX.

➤ After opening the combined.csv file we can see the Sales Record of January header first and then the corresponding values of the January file. In this way, the records of the February file and March file are also appearing serially.
➤ To see the remaining values scroll down throughout the sheet.

open and save in XLSX format

After that, the remnant values will be visible to us also.

open and save in XLSX format

➤ To save the file in XLSX format, go to the File tab.

open and save in XLSX format

Then, you will see various options here, and from them click on the Save As option.

open and save in XLSX format

➤ From the list of different formats we have selected the Excel Workbook option and then the Save option.

open and save in XLSX format

Finally, the name of the merged file is now combined.xlsx.
So, after following the aforementioned steps we have merged 3 Excel files into one with the help of CMD.

how to merge Excel files into one using CMD

Read More: How to Combine Multiple Worksheets into One Workbook


Conclusion

In this article, we tried to cover the steps to merge Excel files into one using CMD quickly. Hope you will find it useful. If you have any suggestions or questions, feel free to share them in the comment section.


Related Articles

Tanjima Hossain

Tanjima Hossain

Hello everyone, This is Tanjima Hossain. I have completed my graduation from BUET. Then I have started working as a technical writer in SOFTEKO. I have grown interest in technical content writing, research topics, numerical analysis related field and so I am here. Besides this I love to interact with different people and I love to spend my spare time by reading, gardening ,cooking etc.

2 Comments
  1. Hi! wanted to know what is the limit of entries which can be merged when using this method? I got to know that the limit of this merger method is upto 30k entries only. Please correct me if I am wrong or else what can be the limit of this?
    Regards,
    Muizz

    • Hello Muizz Shaikh,
      Thanks for your question. The maximum number of entries should be within the limit of the maximum row numbers of Excel which is 1,048,576. So, you can merge the files as long as the entries of the combined file support this limit.

Leave a reply

ExcelDemy
Logo