ExifTool Forum

ExifTool => Newbies => Topic started by: davkamer on September 02, 2019, 07:20:20 PM

Title: conditional rename of files using -if statement
Post by: davkamer on September 02, 2019, 07:20:20 PM
Hello,

Running exiftool version 11.65 on MacOS 10.14.5

I'm trying to rename all .avi files recursively using the following:

exiftool -if '$FileTypeExtension eq "avi"' '-filename<${CreateDate}_${Make}_${Model}.%e' -d %Y-%m-%d_%H%M%S -r /DIR/

this returns "files failed condition" and doesn't rename anything, but if I specify the file it works. I have confirmed that the avi files do have the CreateDate, Make and Model tags.

I've been searching the forum here but have not found any leads to get this working.
Any help would be very appreciated. 
Title: Re: conditional rename of files using -if statement
Post by: StarGeek on September 02, 2019, 07:29:46 PM
See FAQ #16 (https://exiftool.org/faq.html#Q16)
Title: Re: conditional rename of files using -if statement
Post by: davkamer on September 02, 2019, 07:43:09 PM
Thank you for the quick reply, it worked as expected!