How to convert .doc to .odt, keeping the .odt files in the same directories as the .doc?

Greetings all,

I’d like to convert all my .doc files to .odt, but when I use the Document Converter, it seems to only give me one directory in which I can place all the newly converted files. Is there a way to get the Converter to simply convert the .docs into .odt files within all the directories in which .doc files are found?

Thanks very much,

Starkman

You can certainly specify locations if you use the batch facilities from a headless invocation. Investigate the options available like this:-

:~$ /opt/libreoffice5.0/program/soffice.bin --help | fgrep convert
--convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files
      Batch convert files (implies --headless).
      Eg. --convert-to pdf *.doc
          --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc
          --convert-to "html:XHTML Writer File:UTF8" *.doc
          --convert-to "txt:Text (encoded):UTF8" *.doc

If this helps then please tick the answer (:heavy_check_mark:)

…and/or show you like it with an uptick ()

Whoa, wait a second!

All I wanted to do (I’ve managed to do so already) is leave the converted .odt files in the same directories in which their corresponding .doc files reside! Alex, though I’m thankful for you responding, I don’t understand a hair’s breadth of what you posted, and I am glad that using LO’s Document Converter doesn’t require such batch facility!!

The secret, apparently, was in understanding that ticking “include subdirectories” in the Document Converter wizard includes both the searching/importing of all .doc files (for me, it was starting from E:) AND the saving of all .doc files in the corresponding .doc subdirectories. And that’s where the confusion was.

Anytime you choose “include subdirectories,” it always applies to the searching/importing process, but never have I seen it (until now) apply to the saving of any created files. So my thinking was that if I put E:\ in the path to save, then every created .odt file will end up only in that path: E:\ and not in any of the desired subdirectories.

Anyway, ticking “include subdirectories” does include the saving (starting from the given directory), and it worked.

Thanks much,

Starkman

I tried to Accept your answer for you but was unable to do so until 6 Oct (!). Put in a reminder & I’ll do it then (or try yourself).