【发布时间】:2009-09-25 21:12:33
【问题描述】:
例子:
for /? | if (this stream has word "the" in it) {echo the line with "the"}
我需要以某种方式分析重定向流中的文本。
【问题讨论】:
标签: scripting command dos if-statement
例子:
for /? | if (this stream has word "the" in it) {echo the line with "the"}
我需要以某种方式分析重定向流中的文本。
【问题讨论】:
标签: scripting command dos if-statement
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
【讨论】: