• code
  • bash
  • knowledge-backup
  • documents
  • text
  • tiny-helpers

Comparing Word Docs


I have a client who sends me Word documents quite frequently. They are almost always a revision of a previous document. The document is very long and can be challenging to parse. For many years I would just manualy look for what changed, or use the Compare feature in LibreOffice. This never worked well, as it was based on text movement and formatting which caused a lot of changes to be irrelevant. So I mostly just read the entire thing to ensure no changes impacted features I was building.

This week I got a new version and for some reason I thought to myself, can I compare this with diff. It turns out we can.

pandoc -f docx -t old-document.docx -o old-document.md
pandoc -f docx -t new-document.docx -o new-document.md
diff old-document.md new-document.md

The pandoc conversion is excellent and since you end up with a plain txt file, diff does what it does best. I was able to quickly review what had changed and provide feedback without needing to read the entire 8 page document. It is kind of a weird scenario, but hopefully I help one or two people who are also stuck in a document Groundhog’s Day loop.


Feedback:
💙 Likes 📅 Now ⚙️ Defaults 🖥️ Self Hosted