Skip to content

Instantly share code, notes, and snippets.

@schluppeck
Created February 6, 2024 11:18
Show Gist options
  • Save schluppeck/7136943f93262c024dc01f3e87d6bf95 to your computer and use it in GitHub Desktop.
Save schluppeck/7136943f93262c024dc01f3e87d6bf95 to your computer and use it in GitHub Desktop.
convert DOC to DOCX in the command line

Leverage libreoffice to do this job.

Might have to install libreoffice - on macos using brew one way to do this is:

brew install  libreoffice-language-pack --cask libreoffice`

Key idea: use soffice --headless

/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to docx FILE.DOC

Multiple files with --outdir ~/Desktop/output and giving a list of files e.g. *.DOC

Notes

Found details in this online article

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment