Can't use if-statement with ExifTool

Started by Archive, May 12, 2010, 08:54:11 AM

Previous topic - Next topic

Archive

[Originally posted by ginohoskens on 2007-10-25 06:59:04-07]

Wat I want is to change some xmp-info from a jpg whent the iptc-field urgency is set to (for example) 8.
I tried first to get some info for all the files where urgency is set to 8 but it seems to fail.

To be sure that there are files with Urgency set to 8:

Code:
G:\>exiftool -iptc:urgency tmp
======== tmp/magi_20071014_014.JPG
Urgency                         : 5
======== tmp/magi_20071014_020.JPG
Urgency                         : 7
======== tmp/magi_20071014_009.jpg
Urgency                         : 8
    1 directories scanned
    3 image files read

Scan directory for files with urgency set to 8
G:\>exiftool -shutterspeed -if '$iptc:urgency eq "8"' tmp
    1 directories scanned
    5 files failed condition
    0 image files read

I tried the same with the command out of the manual:

To be sure all files are created after 2006:04:02:

Code:
G:\>exiftool -createdate tmp
======== tmp/magi_20071014_014.JPG
Create Date                     : 2007:10:14 16:13:10
======== tmp/magi_20071014_020.JPG
Create Date                     : 2007:10:14 16:14:28
======== tmp/magi_20071014_009.jpg
Create Date                     : 2007:10:14 16:12:35
    1 directories scanned
    3 image files read

G:\>exiftool -createdate -if '$CreateDate ge "2006:04:02"' tmp
    1 directories scanned
    5 files failed condition
    0 image files read

Same result : 5 files failed condition.

What am I doing wrong?

Kind regards,

Gino Hoskens

Archive

[Originally posted by exiftool on 2007-10-25 11:33:11-07]

In Windows, command-line arguments have to be in double quotes ("...").
So you want this:

Code:
exiftool -shutterspeed -if "$iptc:urgency eq '8'" tmp

The online documentation and the documentation printed by the
Perl version uses single quotes, but the documentation from the
Windows .exe version uses the Windows quotation technique:

Code:
# add one hour to all images created on or after Apr. 2, 2006
 exiftool -alldates+=1 -if "$CreateDate ge '2006:04:02'" dir

- Phil