For
For
command-parameters
from %I.
individual lines of text and then parsing each line into zero or
more tokens. The body of the for loop is then called with the
passes the first blank separated token from each line of each file.
Blank lines are skipped. You can override the default parsing
(just one)
file-set.
would parse each line in myfile.txt, ignoring lines that begin with
a semicolon, passing the 2nd and 3rd token from each line to the for
body, with tokens delimited by commas and/or spaces. Notice the for
3rd token, and %k to get all remaining tokens after the 3rd. For
file names that contain spaces, you need to quote the filenames with
double quotes. In order to use double quotes in this manner, you also
need to use the usebackq option, otherwise the double quotes will be
are implicitly declared via the tokens= option. You can specify up
and you can't have more than 52 total active at any one time.
You can also use the FOR /F parsing logic on an immediate string, by
Finally, you can use the FOR /F command to parse the output of a
example:
FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i
environment.
empty string
avoids confusion with the modifiers, which are not case sensitive.