Find files that match a pattern

Started by ionel, January 17, 2014, 01:50:08 PM

Previous topic - Next topic

ionel

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!

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ionel

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

Heiko

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

ionel