We ❤️ Open Source
A community education resource
How to batch convert docx files using LibreOffice
Quickly convert docx files into odt, pdf, html, and more.
Years ago, I created dozens of documents using Microsoft Office for graduate school assignments. When I needed to convert those files to a different format without relying on an online tool, open source came to the rescue.
For example, five years ago I took a course where all the documents were provided in docx format. Was there an easy way to convert those files to the open odt format? Absolutely, and it’s simple:
$ libreoffice --headless --convert-to odt *.docx
The above command will convert all docx files in the current directory to odt format.
Read more: 5 tips to get started on accessibility
But, what if I wanted to convert those same docx files to html so I could easily share them on my classroom website? No problem:
$ libreoffice --headless --convert-to html *.docx
Or maybe I wanted to create PDFs from those documents? Just a slight tweak to the command:
$ libreoffice --headless --convert-to pdf *.docx
Running LibreOffice from the command line inside the folder with your files is straightforward, and the conversion only takes a few seconds depending on your processor and memory.
To explore even more command-line features, use the help attribute:
$ libreoffice --help
This is a perfect example of the power and flexibility that open source software brings to everyday tasks.
More from We Love Open Source
- 5 tips to get started on accessibility
- The nuclear engineer who became a software founder
- 5 tips to supercharge your presentation skills
- Columnar vs row-based databases explained
This article is adapted from “The power of LibreOffice” by Don Watkins, and is republished with permission from the author.
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.