get a list of files with the same tag (for example DateTimeOriginal)

Started by chc, February 13, 2023, 09:38:36 AM

Previous topic - Next topic

chc

Is it possible to get a list of files with the same tag, like "DateTimeOriginal", in multiple directory? Or a list grouped by similar tags?
Thanks

StarGeek

Try the -if option.  Using DateTimeOriginal as an example, your command would be

exiftool -if "$DateTimeOriginal" -DateTimeOriginal /path/to/files/

Example, with only two of three files having DateTimeOriginal set.
C:\>exiftool -G1 -a -s -DateTimeOriginal Y:\!temp\cccc
======== Y:/!temp/cccc/File1.jpg
[ExifIFD]      DateTimeOriginal                : 2023:02:13 12:00:00
======== Y:/!temp/cccc/File2.jpg
======== Y:/!temp/cccc/File3.jpg
[ExifIFD]      DateTimeOriginal                : 1999:12:31 23:59:59
    1 directories scanned
    3 image files read

C:\>exiftool -G1 -a -s -if "$DateTimeOriginal" -DateTimeOriginal Y:\!temp\cccc
======== Y:/!temp/cccc/File1.jpg
[ExifIFD]      DateTimeOriginal                : 2023:02:13 12:00:00
======== Y:/!temp/cccc/File3.jpg
[ExifIFD]      DateTimeOriginal                : 1999:12:31 23:59:59
    1 directories scanned
    1 files failed condition
    2 image files read

If you're using Mac/Linux/PowerShell, then change the double quotes into single quotes, as the dollar sign has special meaning when there are double quotes around it.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).