R
Rich Pasco
In a BAT file, I would like to use a FOR statement to parse a comma-
delimited string.
For example suppose string s has value "a,b,c" then I need the FOR
statement to iterate "echo a" and "echo b" and "echo c" in order.
This doesn't work as intended:
for /f "delims=," %%v in ("a,b,c") do echo %%v
It only does "echo a" but not the rest.
I tried adding "tokens=*" but that still doesn't iterate. It puts
b and c into %%w and %%x instead of subsequent iterations.
Please help.
- Rich
delimited string.
For example suppose string s has value "a,b,c" then I need the FOR
statement to iterate "echo a" and "echo b" and "echo c" in order.
This doesn't work as intended:
for /f "delims=," %%v in ("a,b,c") do echo %%v
It only does "echo a" but not the rest.
I tried adding "tokens=*" but that still doesn't iterate. It puts
b and c into %%w and %%x instead of subsequent iterations.
Please help.
- Rich