How to use a double for a looping without setting the variable for some like skip=%%L
, in for loop without using configuration a set variable?
This question possibly be associated with this question, but it doesn't fit what I need. It's not the way to help me. What I am looking for is a way to use following %%
loop within (inside) a For /F loop for using in a skip=%%L
itinerant variable inside loop, without using none variable for skip=??_variable_??
, only skip=%%L
- Is there any way to do this?
:loop
for /f %%L in ('call set /a "_some_count_varible_-=1"') do (
set "_for_loop_L=^tokens^=*^skip^=%%L^delims^=^ ^eol^=" && (
for /f %_for_loop_L% %%F in ('type file_mutiplelines.log') do (
more code here!... using %%L and %%f!
)))
I need make work like this code:
:loop
for /f %%L in ('call set /a "_some_count_varible_-=1"') do (
for /f ^tokens^=*^skip^=%%L^delims^=^ ^eol^= %%f in ('type file_muti_lines.log') do (
more code here!... using %%L and %%f!
))
The accepted answer results in this code:
:loop
for /f skip^=^%1^ ^tokens^=*^ ^delims^=^ ^eol^= %%F in ('type file_muti_lines.log') do (
more code here using %1 and %%f and prevent infinit loop if "%1"=="1" goto :next
for /f %%L in ('call set /a "_some_count_varible_-=1"')do call :loop %%L
)