Batch File: Append a string inside a for loop -
i have following loop:
for /l %%a in (1,1,%count%) ( <nul set /p=" %%a - " echo !var%%a! )
which display this:
1 - rel1206 2 - rel1302 3 - rel1306
i need create variable appends based on number of iterations. example variable after loop:
myvar="1, 2, 3"
example:
@echo off &setlocal set /a count=5 /l %%a in (1,1,%count%) call set "myvar=%%myvar%%, %%a" echo %myvar:~2%
..output is:
1, 2, 3, 4, 5
Comments
Post a Comment