@echo off
set myArray[0]=a1
set myArray[1]=b2
set myArray[2]=c3
set myArray[3]=d4
set myArray[4]=e5
set myArray[5]=f6
set myArray[6]=g7
set myArray[7]=h8
set myArray[8]=i8
set myArray[9]=j9
set /a count=1
for /F "tokens=2 delims==" %%s in ('set myArray[') Do (
echo %count% %%s
set /a count=%count%+1
)
pause
If I have a set of array is being used in the batch file as shown above, may I know what is the simplest method to print them out to have a output like below? What kind of for loop should I use?
1 a1
1 b2
1 c3
1 d4
1 e5
1 f6
1 g7
1 h8
1 i8
1 j9