Google Drive documents

Started by dnmi, November 13, 2024, 10:26:46 AM

Previous topic - Next topic

dnmi

Hi.
I've downloaded all documents from my Google drive via takeout, to migrate to iCloud.

I have all files with a separate json file for each folder.

Am I in the right place to merge these back together? Or is this tool just for photos?

Thanks. 

Phil Harvey

What file formats are these documents?  And can you provide a sample JSON file?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

dnmi

Hi Phil,

Files are pdf's, xlsx, word etc. Just noticed there is a json file per document and per folder.


Phil Harvey

ExifTool can write PDF but not XLSX or Word documents.

First you should check to see if the metadata is still in your PDF file.  Google drive shouldn't have removed it:

exiftool -a -G1 -s FILE

But if it really has been removed then you can copy whatever you want back to the PDF files from the JSON files with a command like this:

exiftool -tagsfromfile %d%d-info.json "-author<PermissionsName" "-createdate<Created" "-modifydate<Content_last_modified" -title -ext pdf DIR

You can get a full list of available tags to copy from the JSON file with this command:

exiftool -s FILE.json

In my example above I show how to copy a few of the more useful ones into common PDF Info tags.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).