Rename Images to incrementing Filenames sorted by timestamp

Started by kurisu27, September 30, 2016, 04:17:22 AM

Previous topic - Next topic

kurisu27

Hi everyone,

I'm quite new at using the exif tool in general, but I've so far succeeded in renaming files and rotating them.
The problem I am facing is that I need to rename filenames sorted by their capture date.

Usually this is no problem if I use something like "-k -filename<CreateDate -d %y%m%d_%H%M%S%%-c.%%le", which gives me of course filenames which resemble the time.
What I would need though is something a bit more simpler, so for example just a custom name with incrementing numbers attached, BUT sorted according to capture time.
Is this even possible? If yes may I kindly ask for some tips on how to do that ? :)

Many many thanks in advance!

Cheers,
Chris

Phil Harvey

Hi Chris,

You can do this with the FileSequence tag and the -fileOrder option:

exiftool -k "-filename<CUSTOM_NAME${filesequence;$_=sprintf('%.3d',$_)}.%e" -fileorder createdate DIR

I am using the sprintf here to format the file number as 3 digits.

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

kurisu27

Hi Phil,

wow, thanks so much! Works like a charm!

Cheers,
Chris