Home » Questions » Computers [ Ask a new question ]

Grep in Microsoft Word?

Grep in Microsoft Word?

Grep in Microsoft Word?

Asked by: Guest | Views: 155
Total answers/comments: 3
Guest [Entry]

"What does ""line"" mean in a Word context? The displayed line, which changes if you do anything to the page formatting? The paragraph? Something else?

You can do a bunch of stuff with Word's find-and-replace functions, including changing the formatting and other non-obvious things, but all of them will only act on the find-what text itself, not on any surrounding text."
Guest [Entry]

"Not got enough rep to comment but I can see this doc vs docx issue discussed so anyone chasing the thread (like I was) may find this helpful.

You do not need a special tool for docx files. docx are zipped XML files.

To extract and strip the XML try something based on

unzip -p ""*.docx"" word/document.xml | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g'

from command line fu"
Guest [Entry]

Fast, free, open-source, and cross-platform solution: github.com/phiresky/ripgrep-all