I've been looking for a solution to my problem, but couldn't find an answer. I'm desperate.
I need to create a script, which concatenates multiple text files into one. my files in folder like this
- aaaa.txt
- aaaa (1).txt
- aaaa (2).txt
- aaaa (3).txt
- bbb.txt
- bbb (1).txt
- bbb (2).txt
- bbb (3).txt
i want merge file like this
- aaaa.txt
- bbb.txt
i have tried like this
@echo off
for /r "." %%a in (*.txt) do (
echo %%~na
type %%a >> %%~na.txt
)
but merge file is empty