2015-02-23 39 views
0

我有很多的文本文件,這樣計數詞彙出現的文件夾中使用PowerShell

D1|This is text 
H1|This is line 

我想指望在所有這些文件在總結「D1」的所有發生的所有文件一個文件夾。

我試圖

Get-ChildItem -Filter "*.text" -Recurse | Select-String -pattern "D1" -AllMatches).matches.count 

,但它無法正常工作。

+0

定義'not working' ... – arco444 2015-02-23 14:58:23

回答

1

原來我錯過了左括號的命令

(Get-ChildItem -Filter "*.manifest" -Recurse | Select-String -pattern "D1" -AllMatches).matches.count 

工作正常,我。

相關問題