作者gecer (gecer)
看板Windows
标题[问题] windows findstr的问题
时间Tue Jun 17 21:08:27 2014
小弟请教findstr有无&的功能
例如
find str "word str" *.txt 表示搜寻包含word 或(or) str的txt档
如果要搜寻包含 word 且(and) str的txt档要怎麽下command?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.255.14.118
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Windows/M.1403010510.A.99E.html
1F:推 junorn :type *.txt | findstr "word" | findstr "str" 06/18 00:39
2F:→ junorn :恩...好像也不对,这样不是同时找 06/18 00:40
3F:推 junorn :这样吧... 06/18 00:42
4F:→ junorn :findstr "word" *.txt&&findstr "str" *.txt 06/18 00:44
楼上这样跟find str "word str" *.txt 一样 这样是将包含"word"与"str"的txt档and
我的目的是寻找包含"word"且"str"的txt档(仅包含其中一个字串的不算)
5F:→ maniaque :find money from pocket , no find 06/18 21:31
楼上是什麽意思?愿闻其详
※ 编辑: gecer (111.255.14.118), 06/18/2014 21:58:40
※ 编辑: gecer (111.255.14.118), 06/18/2014 21:59:29
※ 编辑: gecer (111.255.14.118), 06/18/2014 22:00:05
6F:推 junorn :那应该就没办法,findstr搜寻方式也是用部分的正则表 06/19 09:33
7F:→ junorn :示法,印象正则好像没and的搜寻法的样子要问高手了 06/19 09:34
8F:→ junorn :看你要不要到regexp版那边问看看 06/19 09:35