Amend JSON sidecar filenames from Google Photos Takeout to move the parenthesis

Started by bigweed, August 27, 2024, 01:25:53 PM

Previous topic - Next topic

bigweed

Hi all, first time user of ExifTool here!

I have just downloaded my Google Photos as a Google Takeout, and have noticed the JSON filename parentheses issue (as mentioned in below topic):

google takeout places parentheses wrongly in json file name?

I have got Exiftool copied to my Windows Path folder, and am trying to follow along with the solution suggested in the above post. I have opened up a CMD prompt, and entered the below:

exiftool -ext json -r -if '$Filename=~/(\.[^.]+)(\(\d+\)).json$$/i' 
'-Filename<${Filename;s/(\.[^.]+)(\(\d+\)).json$/$2$1.json/}' 'C:\Users\Me\Downloads\Photos Takeout
\Folder Name\Takeout\Google Photos\Folder Name'

When I try the above, I get the below error:

The system cannot find the file specified

I would appreciate if someone can help me out, I am sure I am doing something very obviously wrong. If I only enter the below in a CMD prompt I get the Exiftool help info, so I would imagine the Exiftool is saved in the correct place:

exiftool
Many thanks for all help

bigweed

Figured it out, for Windows it needs to be double quotes, not single:

exiftool -ext json -r -if "$Filename=~/(\.[^.]+)(\(\d+\)).json$$/i"
"-Filename<${Filename;s/(\.[^.]+)(\(\d+\)).json$/$2$1.json/}" C:\Users\Me\Downloads\Photos Takeout
\Folder Name\Takeout\Google Photos\Folder Name

StarGeek

You should double check your images first. Google doesn't remove any metadata from the files, so unless you made edits on the Google website, you do not need to do anything.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

bigweed

You are right, most of the images have correct metadata. I just wanted the OS dates to also align, and quite a few of the images were missing the correct creation/taken date, which happened to be in the JSON - maybe these were Whatsapp files, not sure. But Exiftool has sorted everything out very nicely.

StarGeek

Yes, WhatsApp images don't have any metadata, like most social media images. But the filename usually contains the date, and there are several posts in these forums about how to copy the date into the embedded metadata. But you have it all sorted out, so I'm basically mentioning it for anyone who might come across this in the future.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).