Ask Your Question

Batch Convert Multiple File Types [closed]

asked 2013-07-02 21:13:32 +0200

kevinpete gravatar image

Is there a way to convert multiple file types in a folder with a single command?

I would like to be able to convert any .doc, .docx, .ppt, .pptx, .xls, .xlsx that is added to a folder.

I know how to do this for each individual file type with:

./soffice --headless --convert-to pdf --outdir /FILES2/ /FILES1/*.doc

But would love to be able to handle all files types with one command.

Any help will be greatly appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-03 05:39:47.342319


That works. There will only be 1 file in this folder and it will be cleared out after conversion.

Thanks for your help.

kevinpete gravatar imagekevinpete ( 2013-07-03 17:39:14 +0200 )edit

Please if the answer is right for you, click the √ below the down arrow in the answer.

m.a.riosv gravatar imagem.a.riosv ( 2013-07-03 19:34:05 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-07-03 04:37:32 +0200

oweng gravatar image

In basic terms, if you want to convert all your LO readable file formats to PDF you can use file globbing i.e.,

$ soffice --headless --convert-to pdf *.*

Obviously though if you have a.odp, a.ods, a.odt, etc. you are going to overwrite the output PDF from a.odp and a.ods with that for a.odt, so this may not be an ideal solution. For a more complex solution I think you would need to write a script to iterate through your known file types and perform the needed file checking.

edit flag offensive delete link more


This did not work for me using Windows 10 and LibreOffice I created a bat file like this:

for %%x in (*.wps *.doc*) do "\Program Files\LibreOffice\program\soffice" --headless --convert-to odt "%%x"
BrentBaccala gravatar imageBrentBaccala ( 2019-03-01 18:34:32 +0200 )edit

Question Tools


Asked: 2013-07-02 21:13:32 +0200

Seen: 9,952 times

Last updated: Jul 03 '13