set create/modified/original dates from filename

Started by go, November 18, 2020, 03:03:16 PM

Previous topic - Next topic

go

I'm nearly there to organise my google photos after using many different scripts and tools.  I'm now - I think - at the last ones, the burst files..  They have a filename such as:

00000IMG_00000_BURST20180804145813501_COVER.jpg
00000PORTRAIT_00000_BURST20180818171921011.jpg

All very consistent and i can filter a folder full of them and reorganise.  What I want to do is take the date portion like:

00000IMG_00000_BURST20180804145813501_COVER.jpg 00000PORTRAIT_00000_BURST20180818171921011.jpg

and I'm assuming the rest of the numbers is time or so, but have no clue..and add them to all dates in the file (create, created, modified, etc). Looks like there are a few others, where most of the dates happen after the keyword BURST

I had used this wonderful one from (https://github.com/kaytat/exiftool-scripts-for-takeout) but it doesn't match the structure, and I don't want to change the filenames of any of the photos.

Would love some help please!!  Thank you in advance!!

Phil Harvey

Try this maybe:

exiftool "-alldates<${filename;s/.*BURST// or $_=undef}" DIR

- 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 ($).

go

Amazingly fast response! Thanks, but unfortunately I get
zsh: bad substitution

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

go

amazing.  thank you both, and apologies for my lack of scrutiny.