ExifTool Forum

General => Metadata => Topic started by: ionel on January 17, 2014, 01:50:08 PM

Title: Find files that match a pattern
Post by: ionel on January 17, 2014, 01:50:08 PM
Hello.

Does somebody know how to use exiftool to find .JPG files that have "-Exposure Program" equal to "Manual" and save the list of the found files in a text file?

Thank you!
Title: Re: Find files that match a pattern
Post by: Phil Harvey on January 17, 2014, 01:57:53 PM
exiftool -if "$exposureprogram eq 'Manual'" -p "$directory/$filename" -ext jpg -r DIR > out.txt

where "DIR" is the root directory containing the images.  The above quoting is for Windows.  Swap the single and double quotes if you are on Mac or Linux.

- Phil
Title: Re: Find files that match a pattern
Post by: ionel on January 17, 2014, 02:48:53 PM
First of all thank you for such a wonderful software.
Secondly thank you for such a quick reply.

Thridly... It didn't work. I guess I am doing something wrong.

I am running exiftool on OSX Mountain Lion Bash.
I did this:
exiftool -if $exposureprogram eq Manual -p $directory/$filename -ext jpg -r img > out.txt

and the output was:
File not found: Manual
    1 directories scanned
    2 files failed condition
    0 image files read


the "img" folder contain only 2 jpeg files. extensions are with capital letters: .JPG

The "Exposure Program" field exists. I checked it again by running:

exiftool -Exposure\Program m-mode.JPG
Exposure Program                : Manual


P.S. photos are taken using Nikon D300s
Title: Re: Find files that match a pattern
Post by: Heiko on January 17, 2014, 03:09:24 PM
Hello Ionel,

Phil has already wirtten it:

> The above quoting is for Windows.  Swap the single and double quotes if you are on Mac or Linux.

In your command are not quotes.

Heiko
Title: Re: Find files that match a pattern
Post by: ionel on January 17, 2014, 04:15:09 PM
Thank you. My mistake