Filter by date

Started by Lybecker, January 06, 2023, 07:27:11 AM

Previous topic - Next topic

Lybecker

Hi,

I'm trying to find all the photos taken in 2022, so I use this command:

exiftool.exe if "$DateTimeOriginal > '2022:01:01'" -T -FileName -DateTimeOriginal <folder>

But I get back, which I do not expect:

6f1f5946-0f3f-4bc7-bbdf-35b3f4f28812.jpg        2019:12:27 08:22:43
77F135B4-4DA2-416E-B4A4-08C75D6259FA.jpg        2019:11:05 20:39:02
79461fdc-6379-46a9-bcbd-f9162189ba45.jpg        2022:11:27 23:30:26
7D26FBDB-4736-4EBC-BEB6-D19F31508DAD.jpg        2019:10:22 17:55:10

What am I doing wrong?

Next step is to copy the files to another location...

Phil Harvey

">" is for numerical comparisons, but "2022:01:01" is not a number.  Use the string comparison "gt" operator instead.

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

Lybecker

#2
Unfortunately, the same result with:

exiftool.exe if "$DateTimeOriginal gt '2022:01:01'" -T -FileName -DateTimeOriginal <folder>

version 12.53

Lybecker

#3
It was the missing dash(-) in front of the 'if' statement. Below works!

exiftool.exe -if "$DateTimeOriginal gt '2022:01:01'" -T -FileName -DateTimeOriginal <folder>

Phil Harvey

You should have also seen this error then:

Error: File not found - if
- 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 ($).

CoraHudson

To choose the dates you wish to sort by, drag down the column.