PCL0769 当前离线
上等兵
TOP
qixiaobin0715 当前离线
大校
@echo off md "合并" for %%i in (202101\*.txt) do ( (for /f "delims=" %%a in ('dir /b /ad^|findstr /v/r "合并"') do ( type "%%a\%%~nxi" ))>"合并\%%~nxi" ) pause复制代码
newswan 当前离线
上尉
D:. │ 1.bat │ 1.txt │ 2.txt │ 3.txt │ ├───11 │ 1.txt │ 2.txt │ 3.txt │ ├───22 │ 1.txt │ 2.txt │ 3.txt │ └───33 1.txt 2.txt 3.txt复制代码
set sour=aaa set dest=bbb for /f "usebackq tokens=* delims=" %%a in (`dir /s /b "%sour%\*.txt"`) do ( type "%%~fa" >> "%dest%\%%~na.txt" )复制代码