中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-07 12:48
48,040 主题排行 / 350,125 发帖 / 今日 0 篇 / 48,252 会员排行
DOS批处理 & 脚本技术(批处理室) » [求助]findstr 的若干参数用法
可打印版本  1,056 / 2
第1楼 plp626 发表于 2008-01-26 15:11
银牌会员 发帖 1,020 积分 2,278
[求助]findstr 的若干参数用法
/L 按字使用搜索字符串。

/OFF 不跳过带有脱机属性集的文件。
/F:file 从指定文件读文件列表 (/ 代表控制台)。

/G:file 从指定的文件获得搜索字符串。 (/ 代表控制台)。
/D:dir 查找以分号为分隔符的目录列表

看的我云里雾里.
那位能给个具体例子
findstr /l ....
findstr /off
...
就行了

[ Last edited by plp626 on 2008-1-26 at 03:20 PM ]
第2楼 NeverAgain 发表于 2008-02-02 03:17
初级用户 发帖 40 积分 67
findstr "computer help" myfile.txt

In the above example, any lines containing "computer help" would be printed to the screen.

findstr /s "computer help" *.txt

Similar to the first example, the above example would find any lines containing "computer help" in any txt file in the current directory and all sub directories

findstr /x /c:"computer help" *.txt

Match .txt files that contain an exact match on "computer help"; therefore, files that contain "computer helps" or other non-exact matches will not be displayed. It is important to realize that using /x must be a line that exactly matches "computer help"; in other words, if anything else is on the same line, it's not an exact match.

findstr /n /i /c:"computer help" *

Search for any file containing "computer help" regardless of its case and display the line where the text is found.
第3楼 Climbing 发表于 2008-02-02 10:09
铂金会员 发帖 2,753 积分 6,962 来自 河北保定
chcp 437
findstr /?
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023