@echo off & setlocal enabledelayedexpansion
md 修改后
set a=1
for /f "delims=" %%i in ('dir /a-d/b *.TXT') do (
set file=%%~nxi
set file1=%%i
call:RR
)
exit
:RR
if !a! lss 1000 (
if !a! lss 100 (
if !a! lss 10 (
set R1=000!a!
) else set R1=00!a!
) else set R1=0!a!
) else set R1=!a!
for /f "delims=" %%b in ('more "%file1%"') do (
echo %R1%、%%b>"修改后\%file%"
goto:QQ
)
:QQ
more +1 "%file1%">>"修改后\%file%"
set/a a+=1
goto:eof