Hi guys
I'm using this command to rename JPGs and their matching XMPs to the data taken:
exiftool "-filename<filemodifydate" "-filename<datetimeoriginal" -d "%Y-%m-%d_%H-%M-%S.%%e" *.jpg *.xmp
I'm getting errors because some of the photos have exactly the same time, so it won't rename them. How can I get around this? Increment the times by a few seconds, say?
Many thanks.
Take a look at the %c variable (see the docs for -w option (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut)). This will add a counter number when there's a duplicate name.
So if you change your date option to -d "%Y-%m-%d_%H-%M-%S%%-c.%%e", two files with the same timestamp would end up like this:
2018-06-11_11-39-46.jpg
2018-06-11_11-39-46-1.jpg
Excellent, many thanks.
ANd how can I include a string in the new file name, prefixed at the beginning? Such as
France 2018-08-23_12_24_23.jpg
Cheers.
Is this what you mean?:
-d "France %Y-%m-%d_%H-%M-%S%%-c.%%e"
- Phil
Thank you, Phil.