Converting all OpenOffice files within a folder structure

Could someone help me what the commands are to convert all ods,odt,odp (OpenOffice) files to Gdoc files and place the copies within their respective folders.

So for example if I want to start with a sub folder called Admin how do I make sure it only makes Gdoc version copies of ods,odt,odp files?

So you want to take a directory of ods,odt,odp files and upload them to Google drive as google documents?

Check out the import/export docs from the google drive backend.

I think doing the upload with --drive-import-formats ods,odt,odp should do the trick.

So set up the remote according to the backend docs - say you called it gdrive.

Then something like

rclone copy -v /path/to/Admin gdrive:Admin --drive-import-formats ods,odt,odp

This will upload the contents of Admin, but convert the docs into google docs.

1 Like

Hey Nick, thanks for your reply.

The OpenOffice files are all over the Google drive. I want rclone to find them and convert them to their respective gdocs file type.

Is this possible? And what happens to the sharing permissions?

Did the files that are in the drive get uploaded from your computer? If so then the technique above will work.

If you just want to convert docs that are already in your drive then that is a bit harder.

Rclone doesn't mess with sharing permissions. If you share a folder then everything within it will stay shared.

Yes that is the case. Actually the drive has had OpenOffice files added by many different people overtime and now I'd need to convert them all into their respective Gdoc equivalents.

By a bit harder, what did you mean by that?

OK

This is the best I came up with

rclone move -v --drive-skip-gdocs --include "*.{ods,odt,odp}" drive:GDocs /tmp/GDocs
rclone copy -v --drive-export-formats ods,odt,odp --drive-import-formats ods,odt,odp /tmp/GDocs drive:GDocs 

The first downloads all the docs and deletes them from the source - rclone gets really confused if you leave them on the source unfortunately.

The second uploads them as ods,odt,odp files.

If there is individual sharing set up on the files this will mess it up. If the sharing is based on folders then it will be fine.

If you want to try this I suggest you try lots of tests firsts to see if it does what you want.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.