if condition to look for capitalization in an extension

Started by ahatzz11, July 08, 2017, 04:49:35 PM

Previous topic - Next topic

ahatzz11

Hello! I've done some searching on the form, and a lot of playing around, but haven't been able to figure this out yet.

I'm looking for a way to find images with a capitalized extension e.g. process .JPG but not .jpg.

The -ext option seems to be case insensitive.

I've also tried exiftool -AllDates -if "$FileExtension eq '*.JPG'" ., but that doesn't seem to work either.

Any help on this would be awesome, thanks!


StarGeek

Since you mention the FileExtension tag, I assume you have the example config file set up.  In that case, you're really close, you just need to remove the AsteriskDot part.
exiftool -AllDates -if "$FileExtension eq 'JPG'" .

For others who don't have that installed, the following will work.
If you're looking for exactly JPG and not worrying about jPG or other variations, you can use this:
exiftool -alldates "$filename=~/\.JPG($)/"

If you want to grab everything that doesn't match jpg, then you could use this
exiftool -alldates "$filename!~/\.jpg($)/"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ahatzz11

I didn't have that installed, but I did that and it didn't work, but I switched up some quotes and it's working!

exiftool -AllDates -if '$FileExtension eq "JPG"' .