English
Ask Your Question
2

Bulk file conversion using command line

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

Zumbs gravatar image

updated 2012-04-07 14:27:06 +0200

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. https://www.libreoffice.org/bugzilla/show_bug.cgi?id=48413

edit retag flag offensive close merge delete

Comments

It does bulk conversion in GNU/Linux.

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

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 ( 2012-04-07 18:46:21 +0200 )edit

5 answers

Sort by » oldest newest most voted
1

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
0

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

Comments

1

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 http://help.libreoffice.org/Common/Starting_the_Software_With_Parameters

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

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

While waiting for the bugfix, you can use this: http://sourceforge.net/projects/bulkconvertulo/

edit flag offensive delete link more
0

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
0

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

Comments

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 ( 2013-01-26 18:08:54 +0200 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

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

Seen: 6,778 times

Last updated: Apr 22 '13