例子:
for /? | if (this stream has word "the" in it) {echo the line with "the"}
我需要以某种方式分析重定向流中的文本。
例子:
for /? | if (this stream has word "the" in it) {echo the line with "the"}
我需要以某种方式分析重定向流中的文本。
http://www.febooti.com/products/command-line-email/batch-files/ms-dos-command-redirection.html
这个网站有关于你可以在 DOS 中做的不同类型管道的很好的信息。
使用管道,使用竖线“|”。
例如:
将for的输出通过管道传输到find:
for /? | find "the"
输出的前几行:
command Specifies the command to carry out for each file.
Specifies parameters or switches for the specified command.
To use the FOR command in a batch program, specify %%variable instead
If Command Extensions are enabled, the following additional
forms of the FOR command are supported:
If set contains wildcards, then specifies to match against directory