Open Source Musings


(Note: This post was first published at and appears here via a CC-BY-SA 4.0 license.)

If you're like most people, you don't have a bottomless bank account. You probably need to watch your monthly spending carefully.

There are a number of ways to do that, but that quickest and easiest way is to use a spreadsheet. Many folks create a very basic spreadsheet to do the job, one that's consists of two long columns with a total at the bottom. That works, but it's kind of blah.

In this article, I'm going to walk you through creating a more scannable and, I think, more visually-appealing personal expense spreadsheet using LibreOffice Calc.

Say you don't use LibreOffice? That's OK. You can use the information in this article with spreadsheet editors like Gnumeric, Calligra Sheets, or EtherCalc.


In a previous post, I looked at using the lowriter command to convert word processor files to different formats supported by LibreOffice Writer. That post also included a brief mention of the commands for converting spreadsheets and slide decks.

After publishing that post, another way to convert files at the command line using LibreOffice popped into my memory.

Run this command to do a conversion:

soffice --headless --convert-to [file-format] [file-name].[file-extension]

(You might be wondering about the --headless option. That just stops an empty, and mildly annoying, LibreOffice window from opening on your desktop when you do a conversion.)

You can use that command to convert individual file or do a bulk conversion. If, say, you want to convert a Word file to PDF, use this command:

soffice --headless --convert-to PDF myFile.docx

For example, use the command below to convert all Microsoft Excel files in a folder to ODS (the format used by LibreOffice Calc):

soffice --headless --convert-to ods *.xlsx

Why use this method instead of the one I wrote about previously? It works with all formats supported by LibreOffice. And you only need to remember one command, rather than the commands for each component of the LibreOffice suite.

Scott Nesbitt

#linux #cli #opensource #libreoffice

Recently, I came across some documents that I'd written at a former Day JobTM. A company that uses That Other Word Processor. You know the one I mean ...

I wanted to convert those files to both ODT and PDF. Opening them individually in LibreOffice Writer to do the deed would have been a chore. Plus, I'm lazy. So I needed to find a different solution.

Then I remembered that you can run LibreOffice Writer from the command line. Really! And, in doing so, you can convert files in bulk. To do that, crack open a terminal window. Then type:

lowriter --convert-to [file-format] *.[file-extension]

To convert the files I wrote using that other word processor to ODT, I typed:

lowriter --convert-to odt *.docx

In a few seconds, I had a bunch of ODT files. I did the same thing to create a bunch of PDF files, just substituting odt in the command with pdf.

You can convert between files in any format that LibreOffice Writer supports. You can also convert individual files. Just type the name of the file at the end of the command.

But what about spreadsheets and slide decks? You can also use the —convert-to option with the commands localc (LibreOffice Calc) and loimpress (LibreOffice Impress) to convert a file or to do a batch conversion.

Scott Nesbitt

#linux #cli #opensource #libreoffice