作者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/m.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