批处理数字前加0
1-5
变为
01-05的形式
@echo off&setlocal enabledelayedexpansion for /f "tokens=1,2 delims=-" %%a in (rq.txt) do ( echo 源串:%%a-%%b pause if 1%%a lss 100 (set var1=0%%a) else set var1=%%a if 1%%b lss 100 (set var2=0%%b) else set var2=%%b echo !var1!-!var2!>>test.txt ) del /q rq.txt ren test.txt rq.txt 1pause
posted on 2017-04-04 13:42 zhanglei1371 阅读(667) 评论(0) 编辑 收藏 举报