Convert Linux .odt files to Windows .docx using a script

I am frequently using the public library and my laptop to do document editing.

My laptop has UM 24.04.

I would like a script to convert .odt files to .docx files.

Is it possible to save both .odt and .docx files without manually saving 2 files for each document ?

1 Like

libreoffice contains a number of convert options; which can be run from CLI too (ie. using a --headless option)

libreoffice --headless --convert-to docx *.odt

It actually will do a lot, so I'll suggest reading the man or info page(s) for more. What I'll suggest anyway (not sure I've ever used it in that way in years)

5 Likes

Thanks.

If I am at the command line and I remember the manual, I will use it.

This works too but did not time to see if it works with wildcards.

#!/bin/bash

soffice --convert-to docx Christus_Health.odt

I just remembered something. The margins will probably need to be adjusted before printing so I do not have to pay another dime for a blank page. :slight_smile: