I have several folders with files. Files can have the same names. I want to concatenate files into one of each name. Thanks in advance.
EDIT: I\'m sorry
merge.bat
@echo off
# for every text file in
# the sub-dirs of current dir
for /r "." %%a in (*.txt) do (
# filename without path and extension
echo %%~na
# read file and append it to file with
# the same name prefix in current dir
type %%a >> %%~na-merged.txt
)
merge_all_in_one.bat
@echo off
for /r "." %%a in (*) do (
type %%a >> all_merged.txt
)