Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
Related stackoverflow answer. –  jw013 Jan 6 '12 at 20:24
    
I got rid of the DOS part, since that's off-topic here –  Michael Mrozek Jan 6 '12 at 21:15
    
Related: Command-line-friendly full-text indexing? –  Gilles Jan 7 '12 at 0:11
add comment

3 Answers

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.

share|improve this answer
add comment

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).

share|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 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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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