R02 u70.843 i-19.91 5-10.17 I5.641
U71.796 B-18.487 5-8.11 I4.556
G75.13 H-10.666 5-9.16 I-9.209
F75.13 5-7.27 H-10.666 I-9.209
Among the above, the number after 5- is 10.17 which is the largest, so display 5-10.17
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (a.txt) do (
for %%i in (%%a) do (
set "var=%%i"
if "!var:~,1!" equ "5" (
set "var= !var!"
set "_!var:~-10!=%%i"
)
)
)
for /f "tokens=2 delims==" %%i in ('set _') do set "max=%%i"
echo %max%
pause
The code works. However, if it's executed on a 10MB text, the execution efficiency is extremely slow, taking almost half an hour. VBS is also okay, as long as it's faster.
[ Last edited by dragonamd on 2008-9-12 at 05:10 AM ]
U71.796 B-18.487 5-8.11 I4.556
G75.13 H-10.666 5-9.16 I-9.209
F75.13 5-7.27 H-10.666 I-9.209
Among the above, the number after 5- is 10.17 which is the largest, so display 5-10.17
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (a.txt) do (
for %%i in (%%a) do (
set "var=%%i"
if "!var:~,1!" equ "5" (
set "var= !var!"
set "_!var:~-10!=%%i"
)
)
)
for /f "tokens=2 delims==" %%i in ('set _') do set "max=%%i"
echo %max%
pause
The code works. However, if it's executed on a 10MB text, the execution efficiency is extremely slow, taking almost half an hour. VBS is also okay, as long as it's faster.
[ Last edited by dragonamd on 2008-9-12 at 05:10 AM ]

