Page 1 of 1

Sort by date taken - CMD utility

PostPosted: Wed Sep 23, 2020 11:22 pm
by steve
Hi, I'm using the command line utility as part of a batch script to process photos from work each day.

In the GUI it is possible to first sort by date taken which works great when I have photos from multiple cameras. But I can't seem to get this to work in the CMD line utility. Is it possible?

Thanks in advance!

Re: Sort by date taken - CMD utility

PostPosted: Thu Sep 24, 2020 10:52 am
by Luuk
Greetings, the CMD utility cannot see inside the exif values for date taken sort, but it can sort by the dates modified, created, accessed, and for this to use /sortby:m, /sortby:c, and /sortby:a. If it must be urgent to sort by exif values, I must recommend the exiftool, and then to use it like "exiftool -fileorder datetimeoriginal ."

Re: Sort by date taken - CMD utility

PostPosted: Thu Sep 24, 2020 8:04 pm
by steve
Thanks very much, I will try that.

Re: Sort by date taken - CMD utility

PostPosted: Fri Sep 25, 2020 2:17 pm
by steve
In case anyone else was looking to do the same thing, here is the command I used, on windows, to rename all images in the directory by EXIF creation date:
Code: Select all
exiftool -ext jpg "-filename<DateTimeOriginal" -d %Y-%m-%d-%H-%M-%S%%-c.%%le .


In my case I am using it in a batch file which means the % symbols need to be escaped first like so
Code: Select all
exiftool -ext jpg "-filename<DateTimeOriginal" -d %%Y-%%m-%%d-%%H-%%M-%%S%%%%-c.%%%%le .


I just inserted this line in before the line from BRC64, because I already had a working (complicated) rename command, I just needed the files to be properly sorted first.