I’m working on something for our fabulous BlogEnergizer Premium members that’s still kind of hush-hush at this time and hit a predicament.
I have 81 CSV files that needed to be merged into one huge file. I had all of them in one folder and sure as hell didn’t want to sit here copying and pasting 81 files.
As someone who loves automation and tries to batch my work as much as possible, I had to dig for a solution and found one using good old fashioned DOS.
You know, I love modern computing and the snazzy interfaces but at the same time a lot of ‘real computing’ knowledge like using DOS commands is also lost. I’ll admit I’m no where near a DOS ninja I don’t know how to do many things in DOS plus this stuff is kinda scary. However, this was easy.
First, I opened command prompt. If you’re following along, you’d go to Start >> Run >> type cmd in the box and hit Open
Then, I navigated to the folder where all my files are. For convenience and less typing you could simply move the folder containing all the files you want to merge to the top of your C:\ drive. Let’s say your files are in C:\mergefolder, you’d type this in command prompt.
cd \mergefolder
Once in the folder and you can tell because your prompt is now C:\mergefolder>
Now, type this
copy *.csv newfilename.csv
Then hit enter. In a second maybe two, I got a new file (newfilename.csv) with all my content from 81 folders in it.
And now in my folder I’ll find this brand new file named newfilename.csv. Of course you can name the file anything you want.
SO neat and a huge lifesaver. I know this may not be useful to you right this moment but it is one of those posts you will wish you had bookmarked when you find yourself in my shoes later on so go ahead. Share it so you will have it in your stream for later, bookmark using the tools at the bottom of this post or clip it to Evernote.