Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to convert a bunch of xlsx files to xls (because some other software<cough>matlab<cough> can process xls but not xlsx on the mac).

I've tried unoconv but it has issues (which apparently stem from pyuno's shared object not being 64-bit-compatible -- even trying to override this with

$ VERSIONER_PYTHON_PREFER_32_BIT=yes ./unoconv

still dies, this time with Fatal Python error: Interpreter not initialized (version mismatch?) which I'm surmising has to do with a mismatch between the python used with OpenOffice and the one shipped with MacOS X).

I'm using the Microsoft-provided "Open XML Converter" in the meantime, but I'd really like to figure out a way to do it with FOSS tools and via the shell. Any ideas?

Oh, I'm running on Snow Leopard if that makes any difference.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I've not tried this with .xls(x) files per say, but I have used LibreOffice to batch convert .doc(x) files to .pdf using the convert-to option. OpenOffice has the same options, afaik.

Check the help option for your app. In my case it was:

/Applications/LibreOffice.app/Contents/MacOS/soffice -help

In particular, for my switch to .pdf files, I did something like this:

/Applications/LibreOffice.app/Contents/MacOS/soffice -headless -convert-to pdf:writer_pdf_Export *.doc

The -headless flag just prevents the whole GUI from loading. There is likely a similar output file extension and filter (the pdf:writer_pdf_Export) for your .xls(x) case.

share|improve this answer
    
OK, thanks-- OpenOffice 3.3 doesn't have seem to have the -convert-to (and -headless claims to be recognized, but still causes the GUI to fire up). LibreOffice does the trick (though it still seems to be spending time firing up a bunch of stuff in the background). I used this command line: $ /Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to xls 'test 1873.xlsx' –  jhfrontz Jan 30 '12 at 19:46
    
The LibreOffice icon will show up in the dock, but I don't' get it loading a bunch of stuff. Also, for my install, the options aren't long options - they only have one - character, not two. That is interesting about OpenOffice not having these options. There is probably a way to define a macro in OO and then call that macro from the command line, but I'm unsure. –  cm2 Jan 30 '12 at 20:47
    
I get it loading stuff (lots of disk spinning and time elapsed) and actually switching visual focus to the space (virtual desktop) where I have OO pinned -- not intolerable, but not what I would have hoped for "headless". Oh, this is on LibreOffice 3.4.5 OOO340m1(Build:502) –  jhfrontz Jan 31 '12 at 21:29
    
Interesting. I'm using LibreOffice 3.3 330m19(Build:401). Not sure what has changed, but at least it is working for you now :). –  cm2 Feb 1 '12 at 17:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.