Is there a command-line tool to text-search a docx file? I tried grep, but it doesn't work with docx even though it works fine with txt and xml files. I could convert the docx to txt first, but I'd prefer a tool that operates directly on docx files. I need the tool to work under Cygwin.

OP edit: Later I found out that the easiest way to achieve the grep is actually to convert those docx to txt then grep over them.


I know of several indexing tools that support Word documents. Such tools allow you to index documents, then efficiently search words in the index. They don't permit full text searches.

| improve this answer | |

DOCx is compressed and it is not a text format. So what you need is a converter first. After that you can use the find command on the converted file(s).

| improve this answer | |
  • Or you can use a search tool that can read inside compressed files. In your last sentence, I suppose you meant grep? – Gilles 'SO- stop being evil' Jan 6 '12 at 23:32
  • @Gilles - look at the original title of the question before Michael edited it. This seemed to be a question about DOS (and I flagged it off-topic). – Nils Jan 7 '12 at 20:14

Have you looked at openoffice ninja?
(don't know about cygwin support)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.