How to only output files containing the metadata?

Started by PersistentPacifier, May 29, 2021, 07:07:31 PM

Previous topic - Next topic

PersistentPacifier

Hi, I'm running this command:

exiftool -Encryption "C:\tmp\"

tmp is a directory

And exiftool is showing every filepath even if they don't have encryption, how can I do so I only get messages about files that do have encryption tags?
Is this possible to do?

I have a lot of files (10K+) so exiftool returning the path of every single file is not what I'm looking for. I'm using Windows 10.

Thank you.

StarGeek

Use the -if option.
exiftool -if "$Encryption" -Encryption "C:\tmp\"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

PersistentPacifier

Thank you! That worked. Also is there any difference in using this instead:

exiftool -if $pdf:encryption -Encryption "C:\tmp\"

is PDF: redundant or wrong? (that's command line is what I gathered from reading the documentation you linked before seeing that you gave me the command already)

StarGeek

If you use pdf:encryption, then the command will only be true for files have have encryption in the PDF group.  It would not extract tags in other groups.  For example, the Palm MOBI Encryption tag.

In this case, it's fine.  A bit redundant as the Encryption tag only appears in a very few groups.  But in other cases where the same tag name can appear in multiple groups, you might want to include the group and you might not, depending upon what you're looking for.  For example, CreateDate appears in both the EXIF (EXIF:CreateDate) and the XMP group (XMP:Createdate or more specifically, XMP-xmp:CreateDate). If you don't care which tag you get, then you would just use CreateDate.  Otherwise if you wanted one or the other, you would specify the group.

Also, you want to make sure you have quotes around the second argument of the -if option.  Double quotes in CMD, single quotes in PowerShell/Mac/Linux.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

PersistentPacifier

Thank you  for the explanation. I understood perfectly.