思想之翼 当前在线
上尉
评分人数
yhcfsr 当前离线
中尉
@echo off&setlocal enabledelayedexpansion set "sd=D:\数据1" set "dd=D:\数据2" for /f "delims=" %%a in ('dir /a-d/s/b *.txt') do ( set /a "n=1000000" (for /f "delims=" %%b in ('type "%%a"') do ( set "var=%%b" set/a n+=1 set/p"=!n! "<nul echo;!var:~,2! set/a n+=1 set/p"=!n! "<nul echo;!var:~2! ))>"%dd%\%%~nxa" ) pause复制代码
TOP
cfwyy77_bat 当前离线
四级士官
@echo off setlocal enabledelayedexpansion for /f %%a in ('dir /b D:\数据1\*.txt') do ( set nu=1000001 (for /f %%i in (D:\数据1\%%a) do ( set str=%%i echo !nu! !str:~0,2! set /a nu+=1 echo !nu! !str:~2,4! set /a nu+=1 ))>D:\数据2\%%a ) pause复制代码