Merge multiple csv files into a single .csv or .txt file using command line

In this post I’m going to show you how you can take multiple .csv files and merge them into a single .csv or .txt file. The process is very simple and should take a couple of minutes to complete.

For my example I have created four .csv files which contain 3 rows of the letters A, B, C & D. See below.

A.csv B.csv C.csv D.csv
a.csv b.csv c.csv d.csv

STEPS TO CREATE YOUR MERGED CSV OR TEXT FILE

1.Create a folder to store all of the .csv files you would like to merge e.g ‘All csv files’ on your C drive.

All csv files

2.Open notepad and add this text ‘copy *.csv Merged.csv’ (If you want to produce a text file this text will be ‘copy *.csv Merged.txt’)

3.Save the text file to the ‘All csv files’ folder and call it ‘Process’ (the name can be whatever your choose) and change it’s extension to .bat

All csv files with .bat file

4.Double click the Process.bat file and you will see that a .csv file is created in the C:\All csv files folder called ‘Merged.csv’.

All csv files and merged csv file

5. Open your Merged .csv file and you will see that all of your data has been successfully merged. In my example the consolidated data is as follows :

Merged csv file output

This entry was posted in MS Office. Bookmark the permalink.

One Response to Merge multiple csv files into a single .csv or .txt file using command line

  1. Josephina says:

    Seriously like the fresh appear. I liked this content. Thanks a lot for a quality post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>