How to combine numerous text files into one file.

Is there a way to combine numerous text files (200+) into one without having to type the title of each file? Is there an application to do this for Mac?

Posted on Feb 22, 2019 12:23 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 22, 2019 1:21 PM

In the Terminal, change directory to the folder in which only those text files reside. Then, concatenate all 200 text files in alphabetical order into one text file on your Desktop.


cat *.txt >> ~/Desktop/combined.txt


and if you are certain that there are only text files in this location, whether with, or without the .txt extension, then you can abbreviate the command further:


cat * >> ~/Desktop/combined.txt

2 replies
Question marked as Top-ranking reply

Feb 22, 2019 1:21 PM in response to pastorchris

In the Terminal, change directory to the folder in which only those text files reside. Then, concatenate all 200 text files in alphabetical order into one text file on your Desktop.


cat *.txt >> ~/Desktop/combined.txt


and if you are certain that there are only text files in this location, whether with, or without the .txt extension, then you can abbreviate the command further:


cat * >> ~/Desktop/combined.txt

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to combine numerous text files into one file.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.