0

我有一个充满PowerPoint演示文稿(pptx)的目录。我正在尝试查找其中包含“December”一词的演示文稿。在我的 Mac 中,我可以使用 grep,但在 Windows 中,我一直在尝试使用 Powershell 和命令提示符,但它不起作用。

我尝试搜索其他帖子,但我发现的是这样的“其他帖子”

我尝试findstr /s /i /m "\<december.*" *.*在命令提示符下使用,但它只返回一个 .doc 而没有任何 pptx 文件。我知道我有一些 pptx 文件,其中包含“十二月”一词。

我还在 Powershell 中尝试了以下操作:

Location = "C:users\mary\desktop
SearchStr = "december"
Sel = Select-String -pattern SearchStr -path Location
If (Sel -eq null)
{
    write-host "Location does not contain SearchStr
}
Else
{
    write-host "Found 'n Sel"
}
Write-host "end"

我知道该文件无法读取。我希望它查看目录。

任何帮助将非常感激。

4

1 回答 1

2

pptx 文件不是纯文本文件。它实际上是一个 zip 文件(使用 7-Zip 解压出来看看)。搜索你的方式不会产生很好的结果,如果有的话。作为测试,在 Notepad++ 中打开 pptx 并查看它的外观。也许你可以调整https://blogs.technet.microsoft.com/heyscriptingguy/2012/08/01/find-all-word-documents-that-c ​​ontain-a-specific-phrase/ 来做你想要的 pptx,或搜索另一个解决方案,因为您知道纯文本不起作用。

于 2018-05-02T05:52:04.817 回答