Ask Your Question
0

How to (batch) convert Microsoft Office Files from commandline?

asked 2012-02-24 07:10:58 +0200

Harry gravatar image Harry
23 2 3 7

updated 2012-02-24 07:11:33 +0200

Hello,

I'm using LibreOffice 3.4 on Fedora 16. I want to batch convert lots of .xls/x, .doc/x, and .ppt/x files to plain text.

  1. When I issue the following command to just try to convert a single file, the command fails silently with an exit code of 1.

    $ soffice.bin --headless --convert-to txt foo.xls

    $ echo $?

    1

    $

  2. I'd also like to know how to efficiently convert a whole bunch of these files without starting and stopping LibreOffice everytime. It appears that the --accept argument may be the way, but there seems to be no example of this anywhere. Would greatly appreciate if you could share one.

Many thanks in advance, /HS

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

answered 2012-02-24 08:26:52 +0200

drone27of1 gravatar image drone27of1 flag of Canada
216 6

Bug 44496 - convert-to pdf:writer_pdf_Export (headless) fails when LibreOffice already open

Close down all LO instances and it works (tested)

link delete flag offensive edit

Comments

Thanks. Can't upvote your answer due to insufficient points.

Harry ( 2012-02-25 04:58:25 +0200 )edit
0

answered 2012-02-24 08:01:20 +0200

ArtificePrime gravatar image ArtificePrime
1 1

updated 2012-02-24 08:02:46 +0200

Can't speak to the batch capabilities off hand, but as your looking for a command line tool, the first thing that comes to mind is AntiWord. It supports Word files up to MS Office 2003. Unfortunately, if it's not in your repos the RPM links on that page are all out of date (latest version is 0.37 from 2005). I had to build it from source myself recently. I've always found it to work quite well, but I only use it in combination with less for older *.doc files.

Anyway, I hope I've given you a step forward and not fed you a red herring.

link delete flag offensive edit

Comments

Thanks, but I need a converter for not just Word but for Excel and PPT as well. Can't upvote your answer due to insufficient points.

Harry ( 2012-02-25 05:01:03 +0200 )edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-02-24 07:10:58 +0200

Seen: 1,731 times

Last updated: Sep 04 '12