在 Microsoft Word 中使用 Grep?

13 grep microsoft-word

在 Microsoft Word 中使用 Grep?

我想从 Word 文档中提取具有给定字符串的所有行。在 unix 世界中...... grep 做到这一点没有任何故障。Windows 对我来说不太明显。

chr*_*nos 11

使用 Cygwin(或访问 Linux 机器),您可以

antiword file.doc | grep "my phrase"
Run Code Online (Sandbox Code Playgroud)

或者

catdoc file.doc | grep "my phrase"
Run Code Online (Sandbox Code Playgroud)

有很多命令行文件格式转换器可以以类似的方式进行grep

纯粹在 Word 中的解决方案可能是Ctrl+F(查找),然后查找全部- 但是,我不确定是否所有版本的 MS Word 都有查找全部按钮。

  • 当我看到问题标题时,我想“哈!那太好了,不是吗”。我再也不能低估 GNU 程序员了。 (2认同)