Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to combine lots of files in a directory

I've got 50 to 60 files in a directory that I need to concatenate into a single file on a regular basis.

I thought about using notepad++ thinking there was probably a plug-in that would help but haven't been able to find one.

Any other thoughts?

like image 637
tnriverfish Avatar asked Aug 05 '10 19:08

tnriverfish


People also ask

How do I merge lots of files?

To choose the merge option, click the arrow next to the Merge button and select the desired merge option. Once complete, the files are merged. If there are multiple files you want to merge at once, you can select multiple files by holding down the Ctrl and selecting each file you want to merge.

How do I combine the contents of multiple folders into one?

There is no folder merge button to combine multiple folders– you need to manually go into every directory, press Ctrl + A to select all files, create new folders at the destination, and copy-paste the files.


1 Answers

Assuming these are text files (since you are using notepad++) and that you are on Windows, you could fashion a simple batch script to concatenate them together.

For example, in the directory with all the text files, execute the following:

for %f in (*.txt) do type "%f" >> combined.txt 

This will merge all files matching *.txt into one file called combined.txt.

For more information:

http://www.howtogeek.com/howto/keyboard-ninja/keyboard-ninja-concatenate-multiple-text-files-in-windows/

like image 66
JYelton Avatar answered Sep 17 '22 08:09

JYelton