I was facing a situation wherein I had hundreds of files lying around and had to take printout of all the files. Having to take printout of each and every file proved to be nightmare.
The solution was to merge all the files into a single file or copy the contents of multiple files into single file.
Before issuing these commands at the command prompt change to the directory where all the files are present.The code shown below copies the contents from all the files ending with py extension into a new file called mergedFile.doc. The reason I created a word doc file is it’ll be easier to take printout and had no reason to think otherwise.
copy /b *.py mergedFile.doc
If I want to merge multiple text files into a single document file
copy /b *.txt mergedFile.doc
If I want to merge multiple text files into a single text file
copy /b *.txt mergedFile.txt
If I want to merge multiple java files into a single document file
copy /b *.java mergedFile.doc
Code shown here is tested on Windows 7/8/10 machine.