The last statement also adds 'r' as a 'delim'. Delimiters are expected where I've placed commas on the last statement below. Since CMD is also looking for quotes to handle, the quote as a 'delim' must also be escaped. In most cases an alternative to quotes is to escape the command line delimiters. ^ setlocal EnableDelayedExpansion ^ set "var=one"two"three" ^ FOR /f tokens^=1-3^ delims^=^" %%a in ("!var!") ^ do echo %%a-%%b-%%c ^ found by pieh-ejdsch last month It seems that the quotes enclosing the options string are only necessary to prevent the command line delimiters from being recognized and thus causing the line to be separated into useless statements. ^ To use a quote character as a delim character in a ^ FOR /F loop is posible, it only looks a bit ugly.
0 Comments
Leave a Reply. |