Count only if there are mutliple files with the same filename and start with 01

Started by metadata, August 13, 2018, 04:45:32 PM

Previous topic - Next topic

metadata

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

Phil Harvey

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