- @echo off&setlocal enabledelayedexpansion
- (for /f "usebackq delims=" %%a in ("1.txt") do (
- set/a #%%a=!#%%a!+1
- if !#%%a! leq 9 (set n=0!#%%a!) else (set n=!#%%a!)
- echo %%a!n!
- ))>"1_txt"
复制代码
如果重复不超过99次,则可以:- @echo off&setlocal enabledelayedexpansion
- (for /f "usebackq delims=" %%a in ("1.txt") do (
- set/a #%%a=!#%%a!+1
- set n=0!#%%a!
- echo %%a!n:~-2!
- ))>"1_txt"
复制代码
[ 本帖最后由 hanyeguxing 于 2010-12-6 22:10 编辑 ] |