Dear Forum Experts,
I have a collection of scanned PDF files, each with filenames starting with a date in the format year-month-day, followed by descriptive words. For instance: "2021-08-15 Officeworks.pdf". I'm seeking a method to search for files based on these dates. For example, I want to list all files preceding January 29, 2024. Can this be achieved using exiftool?, if yes, could you assist me in achieving this?
Thanks in advance!
Something like this should do it:
exiftool -filename -if "$filename lt '2024-01-19'" -fast5 DIR
The -fast5 isn't necessary, but it will speed things up a lot because you don't need to read any metadata from the file.
There are various options that will allow you to format the output however you want.
- Phil
Oh, I see. So you can compare strings like that directly. I was under the impression that I needed to convert the date strings in the filenames into date objects first. Also, thanks for letting me know about the -fast5 option. I guess I was just being lazy and didn't bother to read the manual properly. Thanks a lot!