- @echo off&setlocal enabledelayedexpansion
- Set iCurOffset=0
- Set iNextOffset=0
- Set iCurMax=0
- Set strOutString=
- for /f "tokens=1,2,3" %%i in (S.txt) do (
- if %%j GTR !iCurOffset! (
- if %%j EQU !iNextOffset! (
- Set strOutString=!strOutString!!strLine!
- Set iCurOffset=%%j
- Set iCurMax=0
-
- )
- )
- if %%j EQU !iCurOffset! (
- if %%i GTR !iCurMax! (
- Set iCurMax=%%i
- Set strLine=%%k
- Set /a iNextOffset=%%i+%%j
- )
- )
- )
- echo %strOutString%%strLine%
- pause
复制代码
|