I am trying to extract tokens from a list of strings using a batch script, but for some reason it ignores my string if it contains an asterisk.
An example to illustrate this problem is as follows:
@echo off
set mylist="test1a,test1b"
set mylist="test2a,test2b*" %mylist%
set mylist="test3a,test3b" %mylist%
echo %mylist%
for %%a in ( %mylist% ) do (
for /F "tokens=1,2 delims=," %%i in ( %%a ) do (
echo %%i
echo %%j
)
)
I would expect this to print out all six tokens but instead it only prints test3a, test3b, test1a, and test1b, like it is ignoring the second string completely.
The placement of the asterisk within the second string doesn't seem to matter, but if I remove it everything works as I expect.
Does anyone know what is going on here?