I have a string "-a valueA -b valueB -c valueC", and I want to use bat to split this string by white space and parse the the value "-a" "valueA" "-b" "valueB" "-c" and "valueC" one by one.
Basically, I want to use the for loop to achieve this, however the for loop in bat seems to be far more complicated than I imagine.
I have tried the following codes but obviously it doesn't work.
set TEST_CODE="-a valueA -b valueB -c valueC"
for /f "tokens=* delims= " %%a in (%TEST_CODE%) do (
echo %%a
)
I'm expecting the output to be
-a
valueA
-b
valueB
-c
valueC
I refer to this link, but I'm still confused what exactly is tokens and delims here. Can some bat expert share some ideas on this?
,,;and=?