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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -