第1个回答 2013-09-24
@echo off
set num=0
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%x in ('type ss') do (
set "str=%%x"
set/a num+=1
rem whether string have key words "STR%%i" or not, if so, executes next procedure
call,set str=%%str:STR!num!=%% && for /f "tokens=2 delims=^=" %%a in ('echo=%%x') do (
set string=!string!-%%a
)
rem strip double quotes in string
set string=!string:^"=!
)
rem get the string
echo=!string:~1!
endlocal
pause>nul