- @echo off
- md New 2>nul
- for %%a in (*.txt) do (
- for /f "tokens=1* delims=-" %%b in ("%%~na") do (
- if not defined .%%b (
- set ".%%b=1"
- copy "%%a" "New\%%b.txt"
- ) else copy /b "New\%%b.txt" + "%%a" "New\%%b.txt"
- )
- )
- pause
复制代码 楼主附件中有个文件的编码为utf-8,请先转换成ansi |