Join several text files into one

I would like to join two as many text files that are found in C:\Files\.... into one file ending in .txt
with no lines that it finds in between the data in one text file and other etc..
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Thomas UCommented:
Hi 100questions

The term you are lookin for is concatenate.

commandline windows

copy /b c:\files\*.txt Alltogether.txt

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewIT / Software Engineering ConsultantCommented:
Make sure you place the joined result file in a different folder, so that you don't concatenate it as well.

aravind ancheWindows/Vmware Commented:
also if they are in c:\files and in subfolders, open command windows in files folder and  run below code
for /R %f in (*.txt) do type “%f” >> c:\alltogether.txt
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Thomas UCommented:
But that adds a carriage return at each line....(and you added too many of those ">>" for the code to work)

just does not add the target "Alltogether.txt" to it,  so copy /b (to avoid any linefeed or special character) to the same folder is just fine. Because it check all the files in the folder, then adds them to another...typical batch...if, wouldn't that lead to an infinite loop? ;-)
But you are right anyway. I would pipe the output to a different folder as well. Just in case.
aravind ancheWindows/Vmware Commented:
Thomas I edited it, sorry for typo
Thomas UCommented:
nah, no worries...If I would get a penny for all my batch mistakes...I would be a rich man... :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.