Last Updated on November 19, 2018 by Dave Farquhar
I had a bunch of CSV files I needed to merge. I don’t spend half an hour loading all of them into Excel and doing a bunch of copying and pasting. Here’s how I merge CSV files from a command prompt.
copy /b file1.csv+file2.csv+file3.csv master.csv
That’s all there is to it. Load the resulting file into Excel, remove the duplicate header rows, and I have one big, master CSV file to work with in a matter of seconds. You can concatenate as few or as many files as you want this way. I happened to have 20, so this bit of command line trickery probably really did save me half an hour.
If manual cleanup in Excel isn’t an option, here’s another way to merge CSV files.

David Farquhar is a computer security professional, entrepreneur, and author. He has written professionally about computers since 1991, so he was writing about retro computers when they were still new. He has been working in IT professionally since 1994 and has specialized in vulnerability management since 2013. He holds Security+ and CISSP certifications. Today he blogs five times a week, mostly about retro computers and retro gaming covering the time period from 1975 to 2000.

I probably would have used Type and redirect, and after the first line, filtered the header:
Type file1.csv > master.csv
type file2.csv | filter “header” >> master.csv
type file3.csv | filter “header” >> master.csv
But then I’m old skool. 😉
Er, Find /v. I forgot I wrote a batch file called “filter” that does it for me. Sigh…