Command Line Conversion – How to Convert Excel File to Calc File

command lineconversionlibreoffice

I know you can use libreoffice as a command line tool and one parameter to convert formats is –convert-to, I do not know of other programs.

However, I do not know how to make it work, what do I have to type with libreoffice or another program to convert from excel to calc or the other way round?

Best Answer

Use the default extension to indicate what you want to convert your file to:

libreoffice --convert-to xlsx filename.ods

to convert a Calc file to Excel (this will create filename.xlsx), or

libreoffice --convert-to ods filename.xlsx

the other way around.

If you want to convert a batch of files in one go, use a *:

libreoffice --convert-to ods *.xlsx

If this doesn't work, either enter the command with sudo, or fix ownership of your .config directory (see here):

sudo chown -R --reference="$HOME" ~/.config