Someone please help me with -if syntax. Trying for the life of me to learn this...
If I run in a Win7 CMD window
exiftool -FileName -Model -ext jpg -r "P:\Pictures\Pictures" -csv > exifdata.csv
The output is
FileName Model
DSC28523.JPG NIKON D200
DSC28537.JPG NIKON D200
But if I run
exiftool -FileName -Model -if Model="NIKON D200" -ext jpg -r "P:\Pictures\Pictures" -csv > exifdata.csv
The output is
2 files failed condition
0 files read
I have tried every combination of ", $, ', eq, =, and '$Model=NIKON D200' etc that I have seen on any webpage and nothing seems to work. I am at my whits end...
Thanks,
-Bob
hello,
did you try :
exiftool -if "$Model=~/D200/"-FileName -Model -ext jpg -r "P:\Pictures\Pictures" -csv > exifdata.csv
or
exiftool -if "$Model=~/NIKON D200/"-FileName -Model -ext jpg -r "P:\Pictures\Pictures" -csv > exifdata.csv
exiftool -FileName -Model -if "$model eq 'NIKON D200'" -ext jpg -r "P:\Pictures\Pictures" -csv > exifdata.csv
greybeard,
Thank you, thank you, thank you. That worked!!!!!!!!!!!!!
I could swear I tried that, but maybe in my late night frustration I missed something. I have done enough programing to know syntax is a must. Now i am off and running to learn some more Exiftool syntax.
-Bob
Quote from: bobndanishopping1 on November 08, 2020, 10:14:51 AMI have done enough programing to know syntax is a must. Now i am off and running to learn some more Exiftool syntax.
Exiftool is Perl based, so learning some of the basics of Perl helps a lot with the more advanced commands.