If you regularly download CSV files from a database, or receive a number of CSV files containing similar information, you might need to combine all of those files into one larger file. The ability to merge CSV files automatically can be a big time and sanity saver. I recently encountered a situation where I had a large amount of data that was split up into about 100 different CSV files, each of which contained the same number of rows with the same type of data in each row. Each CSV file represented an order from a company, and my company needed to be able to quickly sort all of that data into one file. The combined data could then be organized into a pivot table so that our production team knew how much of each product they needed to make. Your reasons for doing this may vary, but it can be the simplest solution if you need to combine and sort a lot of data. Rather than opening each file individually, then copying and pasting all of the data into one file, you can automate the process with the command prompt. Having witnessed someone manually copy and paste all of the data from multiple CSV files into one CSV file, I know that the ability to merge CSV files is one that can be a huge time saver.
Merge CSV Files Into One Large CSV File In Windows 7
January 11, 2012 By
Step 1: Move all of the CSV files into one folder. This file does not need to be on your Desktop, but I typically put mine there for the sake of simplicity. Take note of the location, however, as you will need to reference it later. Additionally, once you have finished the merge CSV files process, the output CSV file will also be located in this same folder.
Step 2: Click the Start button, click All Programs, click the Accessories folder, then right-click the Command Prompt option and choose Run as Administrator. You can also type “cmd” into the search field at the bottom of the Start menu, which will bring up the command prompt as a search result. You can then right-click the Command Prompt search result, then click Run as Administrator.
Step 3: Type “cd,” followed by a space, then followed by the folder location, on the first line, then press “Enter.” If you look at the image below, you will see that my folder is called “csv files” and is located on the Desktop of a user that I have called “Demo.” You can also find the folder location by right-clicking the folder, then clicking Properties.
Step 4: Type copy *.csv all-groups.csv on the next line, then press Enter on your keyboard. You can change the output file name from “all-groups.csv” to whatever file name you wish. The name that you select in this step is going to be the name of the large file containing all of your merged CSV files.
Step 5: Open the folder to see the new file that you just created.
Step 6: Double-click the file to see all of the combined information. In the image below, note that I’ve specified in the third column which file originally contained that line of data. When you merge CSV files, the resulting output file is going to have all of the information organized in this manner, where the data from one file is added after all of the data that has been previously added.