需要每组的文件名数字不间断,以 - 为间隔合并同组文件,并只保留该组第一个文件:- @echo off&setlocal enabledelayedexpansion
- for %%a in (*-1.txt) do set /a n+=1
- for /l %%a in (1 1 %n%) do (
- set n=
- for %%b in (%%a-*.txt) do (
- set /a n+=1
- copy /b "%%a-1.txt"+"%%a-!n!.txt"
- )
- del %%a-*.txt 3>>%%a-1.txt
- )2>nul
复制代码
|