regex : search for files with no specific keyword

Started by sevy, September 26, 2019, 01:52:16 PM

Previous topic - Next topic

sevy

Hello,

I'm looking for a way to find pdf files which are NOT containing a keyword.
I tried
exiftool -r -progress -if "$subject=~/(?!MYKEYWORD)/" -FileName -subject .
exiftool -r -progress -if "$subject=~/(?s)^((?!MYKEYWORD).)*$/" -FileName -subject .
exiftool -r -progress -if "$subject=~/^((?!MYKEYWORD).)*$/" -FileName -subject .

but it does not works :-(

does a RegEx Guru have an idea ??

thanks in advance !

Hayo Baan

To not match you should be able to use !~ instead of =~. Have you already tried that?
Hayo Baan – Photography
Web: www.hayobaan.nl

sevy

Hi,

wonderful, it works with :
exiftool -r -progress -if "$subject!~/MYKEYWORD/" -FileName -subject .

thanks a lot !
hartelijk bedankt

StarGeek

There's also plain old not
exiftool -r -progress -if "not $subject=~/MYKEYWORD/" -FileName -subject .
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).