回复 5# linlianboy
多加一层for循环和一个判断语句即可:- @echo off
- cd /d "D:\auto"
- setlocal enabledelayedexpansion
- (for /f "delims=" %%i in (test.ini) do (
- for /f "tokens=1-4* delims=-" %%a in ("%%i") do (
- if "%%d"=="" (
- echo,%%i
- ) else (
- set str=%%d
- set /a str=str
- if !str! neq %%d set /a str-=1
- echo,%%a----%%b----%%c----!str!----%%e
- )
- )
- ))>new_test.ini
复制代码
|