bat一个问题,就是for循环里的continue的实现 30
findstr/b/c:"Testcase"DlgBox_*.txt>b.txtfor/f"tokens=1,2,*delims=]"%%ain(DlgBox_Setup...
findstr /b /c:" Testcase" DlgBox_*.txt>b.txt
for /f "tokens=1,2,* delims=] " %%a in (DlgBox_Setup1.txt) do (
for /f "tokens=2 delims=(," %%i in (b.txt) do (
if %%b==%%i (echo %%a ] //%%b>>temp.txt)
continue //就是我想在这里实现一个类似c里continue功能的东西,用了goto和call貌似都不行 请高手指点一下- -
)
echo %%a ] %%b%%c>>temp.txt
)
就是如果%%b==%%i 跳出里面的for循环 进入外层的for循环 是break 还是 continue了 忘记了 就指点啊 展开
for /f "tokens=1,2,* delims=] " %%a in (DlgBox_Setup1.txt) do (
for /f "tokens=2 delims=(," %%i in (b.txt) do (
if %%b==%%i (echo %%a ] //%%b>>temp.txt)
continue //就是我想在这里实现一个类似c里continue功能的东西,用了goto和call貌似都不行 请高手指点一下- -
)
echo %%a ] %%b%%c>>temp.txt
)
就是如果%%b==%%i 跳出里面的for循环 进入外层的for循环 是break 还是 continue了 忘记了 就指点啊 展开
1个回答
展开全部
是的,for 循环内部不能有含标签行,也没有 break或continue的方法,要么把内层for 放到外层之外,而外层for 用带参数的 call 来调用它,还有一“笨”法,设一标记变量,不需要继续执行内层循环时,见到标记就空循环,比如:
set "flg="
for /f "tokens=2 delims=(," %%i in (b.txt) do if not defined flg (
if "%%b"=="%%i" (echo %%a ] //%%b>>temp.txt&set flg=y)
set "flg="
for /f "tokens=2 delims=(," %%i in (b.txt) do if not defined flg (
if "%%b"=="%%i" (echo %%a ] //%%b>>temp.txt&set flg=y)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询