Ask Your Question

Bulk file conversion using command line [closed]

asked 2012-04-05 14:02:14 +0200

Zumbs gravatar image

updated 2015-10-30 19:44:50 +0200

Alex Kemp gravatar image

I have a large number of old MS Word documents that I would like to convert to odf using the in-built command line. I'm on a Windows 7 64 bit system and have LibreOffice 3.5 installed. From searching the web, it looks like the following command line command should convert all MS Word documents in E:\Docs\In to odf and place them in E:\Docs\Out.

>soffice.exe --headless --convert-to odf --outdir E:\Docs\Out E:\Docs\In\*.doc

However, the command line does nothing. If I specify a path to a specific document, e.g.

>soffice.exe --headless --convert-to odf --outdir E:\Docs\Out E:\Docs\In\a.doc

the document is converted to a.odf and placed into E:\Docs\Out. So, why doesn't the first command work? Is it a bug, or is it just not intended for bulk conversion of all files in a directory?

Update: I added a bug report for this issue, as it does not seem to be the intended behavior.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-30 19:45:16.597834


It does bulk conversion in GNU/Linux.

luyu gravatar imageluyu ( 2012-04-05 20:10:49 +0200 )edit

It does indeed. I got it working using an Ubuntu live CD along with a USB stick with the files. It's not recursive, though, so I ended up writing a .Net program to iterate through the file system and convert the files, maintaining the directory structure.

Zumbs gravatar imageZumbs ( 2012-04-07 18:46:21 +0200 )edit

5 answers

Sort by » oldest newest most voted

answered 2012-05-21 15:27:51 +0200

Have you looked at unoconv ? It's a tool that communicates with LibreOffice for doing bulk conversions. It can iterate over files in a directory. It supports instructing the import and export filters on the command line so it is more flexible than using the LibreOffice command line.

edit flag offensive delete link more

answered 2013-04-22 14:41:23 +0200

While waiting for the bugfix, you can use this:

edit flag offensive delete link more

answered 2012-09-15 13:25:57 +0200

mat8913 gravatar image

updated 2012-09-15 13:26:29 +0200

If you have cygwin try running:

find /path/to/in/ -regex .\*.doc -exec soffice.exe --headless --convert-to odf --outdir E:\\Docs\\Out {} \;
edit flag offensive delete link more


Hi @mat8913 -- Your other answer looks like a dupe of this one (modulo formatting). If that's the case, please delete it when you get a chance. Thanks!

qubit gravatar imagequbit ( 2013-01-26 18:08:54 +0200 )edit

answered 2012-09-15 13:25:11 +0200

mat8913 gravatar image

If you have cygwin try running: find /path/to/in/ -regex .*.doc -exec soffice.exe --headless --convert-to odf --outdir E:\Docs\Out {} \;

edit flag offensive delete link more

answered 2012-04-05 14:24:33 +0200

vmiklos gravatar image

Iterating over all files of a directory is probably a task for the shell. In case of Windows, that may mean a bat file or a powershell script, whichever sounds easier for you.

edit flag offensive delete link more



I do not mind making a script to do the conversion for me, but if LibreOffice can do it for me, I could use the time for something else. It seems that LibreOffice should be able to do bulk conversions

Zumbs gravatar imageZumbs ( 2012-04-05 16:51:31 +0200 )edit

Question Tools

1 follower


Asked: 2012-04-05 14:02:14 +0200

Seen: 9,185 times

Last updated: Apr 22 '13