SapSat
Разбирает третий столбец
Код:
@echo off
setlocal
set max=0
set min=999
for /f "tokens=3" %%i in (log.txt) do (call:check %%i)
:: Особо не тестировал--------------------------
set /a mid=((max+min)%%2)+((max+min)/2)
::----------------------------------------------------
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%max%\>" "log.txt"') do call:linemax %%i
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%min%\>" "log.txt"') do call:linemin %%i
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%mid%\>" "log.txt"') do call:linemid %%i
echo MAX %max% on lines: %linemax%
echo MID %mid% on lines: %linemid%
echo MIN %min% on lines: %linemin%
goto:eof
:check
if %1 geq %max% set max=%1
if %1 leq %min% set min=%1
goto:eof
:linemax
set "linemax=%linemax% %1"
goto:eof
:linemin
set "linemin=%linemin% %1"
goto:eof
:linemid
set "linemid=%linemid% %1"
Разбирает третий столбец
Код:
@echo off
setlocal
set max=0
set min=999
for /f "tokens=3" %%i in (log.txt) do (call:check %%i)
:: Особо не тестировал--------------------------
set /a mid=((max+min)%%2)+((max+min)/2)
::----------------------------------------------------
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%max%\>" "log.txt"') do call:linemax %%i
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%min%\>" "log.txt"') do call:linemin %%i
for /f "tokens=1 delims=:" %%i in ('findstr /N "\<%mid%\>" "log.txt"') do call:linemid %%i
echo MAX %max% on lines: %linemax%
echo MID %mid% on lines: %linemid%
echo MIN %min% on lines: %linemin%
goto:eof
:check
if %1 geq %max% set max=%1
if %1 leq %min% set min=%1
goto:eof
:linemax
set "linemax=%linemax% %1"
goto:eof
:linemin
set "linemin=%linemin% %1"
goto:eof
:linemid
set "linemid=%linemid% %1"