morinia
asked on
Concatenating multiple text files into one file
If I have multiple text files in a folder (Folder A). Does any one know through Windows scripting how to concatenate them into one file without maually cut and pasting?
Example
Text1.txt
Text2.txt
Text3.txt to Text4.text (which has all the files)
Example
Text1.txt
Text2.txt
Text3.txt to Text4.text (which has all the files)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also do
copy c:\someotherdir\*.txt C:\alldir\all.txt
(as otherwise all.txt would be included in the output!)
or
type c:\somedir\*.txt > c:\alldir\all.txt
or if you want a little header saying which file it is:
find /v "something-not-in-any-file zxzxcvbz" *.txt > all.txt
copy c:\someotherdir\*.txt C:\alldir\all.txt
(as otherwise all.txt would be included in the output!)
or
type c:\somedir\*.txt > c:\alldir\all.txt
or if you want a little header saying which file it is:
find /v "something-not-in-any-file
If there's any chance of non-ASCII characters in one of the files, use the /b option for the copy command: