- @echo off
- setlocal EnableDelayedExpansion
- cd /d "%~dp0"
- set srcfile="z.txt"
- set dstfile="zz.txt"
- set prefix=【
- set suffix=】
- set length=3
- set decimal=000000000000
- (
- for /f "tokens=1* delims=:" %%A in ('findstr /nr .* %srcfile%') do (
- set n=%decimal%%%A
- set n=!n:~-%length%!
- echo %prefix%!n!%suffix%%%B
- )
- )>%dstfile%
- endlocal
- pause
- exit /b
复制代码
|