类似
set flag=0
for /f "tokens=1,*" %%i in (temp.txt) do (
if "%%i"=="Specification" set t=%%j&set /a flag+=1
if "%%i"=="product" set m=%%j&set /a flag+=1
if !flag! EQU 2 goto :ExitFor
)
:ExitFor
if "%t:@=%"=="%t%" if "%t:Hz=%"=="%t%" if not "%f%"=="" (
for /f "tokens=1,2,3" %%i in ("%f%") do (
set c=%%j%%k
if %%j GTR 1000 if /i "%%k"=="MHz" (
set c=%%j
set c=!c:~0,-3!.!c:~-3!
set c=!c:~0,-1!GHz
)
)
set t=%t% @ %c%
)