How to search for text programmatically in MS Word

Hi folks,

In this article I discuss a quick way to programmatically search for simple text in an MS Word document. It’s really easy, just use grep!

grep <string to search> /path/to/file

It turns out that even though there are a bunch of non-intelligible characters in the file, ordinary text is stored as it is for the most part. Now if you have some special formatting on your text, I can’t guarantee this technique will work. But it’s worth a shot.