I have two strings:
jobID: w,x,y,z
Test: A,B,C,D
I'm iterating the second string (after separating it by comma) and print both the value of that generated list and the one from the first string.
My code until now is this:
@echo off
setlocal EnableDelayedExpansion
set num=-1
for %%a in ("%jobID:,=" "%") do (
set /A num+=1
set elem[!num!]=%%a
)
set i=-1
for %%a in ("%Test:,=" "%") do (
set /A i=i+1
echo file name is %%a and first list element is !%elem[!%i%!]%!
)
What I'm expecting is this:
file name is A and first list element is w
file name is B and first list element is x
file name is C and first list element is y
file name is D and first list element is z
What I get:
file name is "A" and first list element is "0"
file name is "B" and first list element is "1"
file name is "C" and first list element is "2"
file name is "D" and first list element is "3"
EDIT: I need to get the values without the double quotes.