I need to loop through a file, affect the values to a variable, then loop into a second file and use these previous variables:
for /F "delims=, tokens=1-3" %%a in (Test_1.txt) do (
set Var1=%%b
set Var2=%%c
for /F "delims=, tokens=1-4" %%a in (Test_2.txt) do (
if "%%d"=="" (
echo %%a !var1! !Var2!>>Test_3.txt
)
)
)
How can I affect the first parameters to a variable?
%%aas loop variable like the outer FOR using%%a,%%band%%cfor the three tokens, but for example%%dand so%%d,%%e,%%fand%%gfor the four tokens. PS: I recommend to use upper case loop variables instead of lower case. Run in a command prompt windowfor /?to get displayed the help on several pages and read especially the section about the modifiers and you should know why the usage of%%Ato%%Gwould be better as less confusing.for /Floops are not the right choice...