如何在不使用skip=%%L
设置变量的情况下在循环中使用双精度,而在for循环中不使用配置变量来设置?
此问题可能与此question相关,但它不符合我的需求。这不是帮助我的方法。我正在寻找的是一种在For / F循环内(内部)使用以下%%
循环的方法,以便在循环内的skip=%%L
巡回变量中使用,而对于< [skip=??_variable_??
,仅skip=%%L
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 (
echo=;%%~L;%%f;|findstr /lvie "specific_string"
)))
我需要像这样的代码进行工作:
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 ( echo=;%%~L;%%f;|findstr /lvie "specific_string" ))
set /a _some_count_variable_less_one_ = _some_count_variable_ - 1
for /f "tokens=* skip=%_some_count_variable_less_one_% delims= eol=" %%f in ('type file_mutiplelines.log') do (
echo=;%_some_count_variable_less_one_%;%%f;|findstr /lvie "specific_string;"
)