回复 12# meiszp
不通用,仅针对样本写的- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1,2*delims=:" %%i in ('"findstr /n . *.txt|findstr /c:"txt:5:" /c:"excluding mass coefficients""') do (
- if defined _%%i (set $%%i=%%j) else for /f %%k in ("%%k") do set "_%%i=%%~xnk"
- )
- (
- for /f "tokens=1,2,4,6*delims=:=[" %%a in ('findstr /inrc:"\<MAIN .*\[NS*/M\]$" *.txt') do (
- if %%b gtr !$%%a! (
- if !num! == !_%%a! (
- if defined str (set str=!str! %%c %%d)else set str=!num! %%c %%d
- ) else echo;!str: =!&set num=!_%%a!&set str=!num! %%c %%d
- ) else if not defined num set num=!_%%a!
- )
- echo;!str: =!
- )>out.log
- pause
复制代码
|