ExifTool Forum

ExifTool => Newbies => Topic started by: metadata on August 13, 2018, 04:45:32 PM

Title: Count only if there are mutliple files with the same filename and start with 01
Post by: metadata on August 13, 2018, 04:45:32 PM
Hi,

I'm trying to rename a bunch of pictures according to the datetime they were taken. I got it working, but there is a minor issue. If I shoot photo stacks (EV stacks, e.g.) photos can be taken at the same second. Renaming them with

exiftool -V -d "%Y-%m-%d-LocationDescription-%Hh%Mm%S" '-FileName<${DateTimeOriginal}.%le' . Leads to errors because the stack photos would have the same filename.
Using
exiftool -V -d "%Y-%m-%d-LocationDescription-%Hh%Mm%S" '-FileName<${DateTimeOriginal}%-2nc.%le' .
Solves the issue. But then the first image of a stack doesn't have the counter.
exiftool -V -d "%Y-%m-%d-LocationDescription-%Hh%Mm%S" '-FileName<${DateTimeOriginal}%-.2nc.%le' .
Adds -01 to every file. Not just the stacks.

Is there a way to add -01 only when there is a following -02?

Regards
Title: Re: Count only if there are mutliple files with the same filename and start with 01
Post by: Phil Harvey on August 13, 2018, 09:54:40 PM
No.  But you could do a 2nd pass to do this:

exiftool -filename=%f-01.%e -sourcefile %d/%-.3f.%e *-02.*

This has a chance of working, but I can't test it right now.

- Phil