Command for "filename doesn't conain"

Started by ericconn, November 12, 2014, 12:17:13 PM

Previous topic - Next topic

ericconn

Per the application documentation, if I want my command to only affect files with a certain file name, I use something like exiftool -o %d%f.xmp dir. How do I tell ExifTool the opposite, as in to ignore files that have a certain string in them? In my instance I'm copying files based on keyword, so my code looks like this:

exiftool -if "$keywords =~ /KEYWORD/i" -o "C:\DESTINATION" -r %f(excluded filename) "C:\SOURCE"

Also, the bit of the file name that I want to exclude is in the middle of the file name. Do I need wildcards (*)'s around it? Thanks so much.

Phil Harvey

to exclude processing files names containing "string", you could do this:

exiftool -if "$filename !~ /string/" ...

- 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 ($).