Skip to content

Converting spreadsheets to text files from the command line

February 5, 2013

I just discovered a great command line tool called unoconv, which converts among any kind of document that libreoffice can understand (e.g. xls, csv, etc).

I was driven a little crazy trying to install it, so I’m writing down the steps that worked on my system:
1. Download and install libreoffice (NOT openoffice, which gave me headaches).
2. Download unoconv.
3. In the downloaded unoconv folder, find the unoconv file and put it in /usr/bin/

Here’s how you use it. Say you want to convert a spreadsheet called file.xlsx to a comma separated file (csv). Then from the command line do:

unoconv -f csv file.xlsx

Important: make sure libreoffice is not running.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: