Concatenate multiple text files into one using Windows

Here’s the problem, you get a hundred text files full of juicy details that you want to import to your database/excel sheet/whatever, but now you are faced with importing each one individually. Not nice.

Wouldn’t it be easier if they were all in just one big text file? Here’s how you do it in Windows…

Go to the start menu and run the program cmd.exe This brings up the DOS prompt.

Navigate using “cd” to the directory with your files.. i.e (cd C:/Users/Gary/Desktop/myfiles )

Then use the DOS Copy command to concatenate all these files into one single file…

copy /a *.txt aggregate.txt

This takes any file with a .txt extension and copies its contents into the aggregate.txt file in the same location. (You do not even need to create the aggregate.txt file yourself).

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Concatenate multiple text files into one using Windows

  1. neil says:

    Well, you learn something every day. I had no idea what concatenate meant, until now. Only previous reference I had to the word was “Concatenation”, being the opening track of Swedish Tech Metal band Meshuggah’s album ‘Chaosphere’.

    Worth a listen if you’ve never heard it:
    http://www.youtube.com/watch?v=oK0tjSvA17g

    Make sure you have the volume cranked right up first though!

  2. Gary says:

    That is a rather jolly little ditty. Thanks for posting!

  3. Graeme says:

    An extraordinary piece of music. Not a patch on Napalm Death though.

Leave a Reply

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