我明白原因了。。。试下这样!- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=2 delims={}" %%a in ('findstr/i "\<uid\>" l.log') do (
- set "var=%%a"
- set/a _!var:-=#!+=1
- )
- for /f "tokens=1,* delims=_=" %%a in ('set _') do (
- set var=%%a
- echo uid={!var:#=-!} %%b条
- )
- pause>nul
复制代码
|