Ignoring characters at start of filename when changing dates.

Started by Horns, December 11, 2023, 03:25:57 AM

Previous topic - Next topic

Horns

Hi,

I'm trying to change the exif dates of a bunch of files based on the filename. I've tried using exiftool "-AllDates<Filename", but it gets tripped up by some digits that appear at the start of the filename - these are formatted eg 00097158-PHOTO-2023-09-24-17-43-57.jpg

Is there a way to ignore the first 8 characters in the filename when doing this?

Thanks!

StarGeek

Try
exiftool "-AllDates<${Filename;s/^\d+//}" /path/to/files/

This uses Perl Regular Expressions (RegEx) to strip away all numbers from the start of the filename.

This command is for Windows CMD.  Change the double quotes into single quotes for Mac/Linux.
"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