How to merge multiple csv files in to one file

Suresha HP
Analytics Vidhya
Published in
3 min readJun 29, 2021
Multiple csv to single csv using cmd prompt

A Comma Separated Values (CSV) file is a plain text file that contains a list of data. These files are often used for exchanging data between different applications. For example, databases and contact managers often support CSV files.

These files may sometimes be called Character Separated Values or Comma Delimited files. They mostly use the comma character to separate (or delimit) data, but sometimes use other characters, like semicolons. The idea is that you can export complex data from one application to a CSV file, and then import the data in that CSV file into another application.

The Structure of a CSV File

A CSV file has a fairly simple structure. It’s a list of data separated by commas. For example, let’s say you have a few contacts in a contact manager, and you export them as a CSV file.

They can be more complicated , and can contain thousands of lines, more entries on each line, or long strings of text. Some CSV files may not even have the headers at the top, and some may use quotation marks to surround each bit of data, but that’s the basic format.

That simplicity is a feature. CSV files are designed to be a way to easily export data and import it into other programs. The resulting data is human-readable and can be easily viewed with a text editor like Notepad or a spreadsheet program like Microsoft Excel.

How to merge multiple csv file using Command Prompt

Step1 : Copy the file folder path where you stored multilple csv files

Step 2 : Go to command prompt

Step 3 : Change directory using cd.. till you reach your folder (where you have multiple *.csv file)

Step 4: type as follows in the command prompt
copy *.csv filename.csv
press enter

filename can be of your choice to which all the data from multiple csv files to be merged.

Step5: go and check your folder, you can see the filename given with all data merged as single csv

example — folder with multiple csv
example — cmd prompt showing single merged.csv file

Conclusion:

In this article i tried to explain in simple steps how to combine multiple csv files in to one single file using command prompt , there are several other methods using different programming languages and tools.

Connect with me through Linkedin and Medium for new articles and blogs.

— — — * — — — * — — — * — — — * — — — * — — — * — — — * —

“Develop a passion for learning. If you do, you will never cease to grow” Anthony J. D’Angelo

— — — * — — — * — — — * — — — * — — — * — — — * — — — * —

--

--

Suresha HP
Analytics Vidhya

Machine Learning & Artificial Intelligence Developer, Researcher with over 17+ years experience in different sectors and industry