ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: StarGeek on August 01, 2011, 10:54:53 PM

Title: Limit output to applicable files
Post by: StarGeek on August 01, 2011, 10:54:53 PM

I've looked around but couldn't find an answer, so time to ask.

Is it possible to limit output to only the files that have the specific info I'm looking for? 

For example, if I have a directory with 1,000 files in it and one file has a comment in it, if I run ExifTool -comment on that directory, I'll get a line for each file in that directory even though most won't have a useful response. 
Title: Re: Limit output to applicable files
Post by: Phil Harvey on August 02, 2011, 07:27:08 AM
You can use the -if option, like this:

exiftool -if '$comment' -comment DIR

(note: use single quotes as above on Mac/Linux, or double quotes around "$comment" in Windows)

- Phil
Title: Re: Limit output to applicable files
Post by: StarGeek on August 02, 2011, 05:48:13 PM
Excellent.   Works great.  Thank you very much.