ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Birdman on March 06, 2021, 04:10:54 PM

Title: Placeholder in keyword-search possible?
Post by: Birdman on March 06, 2021, 04:10:54 PM
Hello there,

is there a way to put placeholders in a keyword-search? I still have problems with Umlaute (ä/ö/ü) and there is no way to chnage this in Win 10 unless other software is affected. So I am looking for a replacement for the "ä" in "Gewässer", something like this: "Gew?sser". I even tried ASCII-Code, like shown in my comand shell: "Gew├ñsser" but this didn't work.

exiftool -if "$keywords" -sep "," -keywords= "-keywords<${keywords@;$_ = undef unless /XXX|Name1|Name2|Gewässer|See/i}" -overwrite_original D:\Bilder\X_Metadaten\*.jpg
Title: Re: Placeholder in keyword-search possible?
Post by: StarGeek on March 06, 2021, 06:03:36 PM
Use a single dot . to replace a single character.  In RegEx, the dot is the wildcard for a single character.
exiftool -if "$keywords" -sep "," -keywords= "-keywords<${keywords@;$_ = undef unless /XXX|Name1|Name2|Gew.sser|See/i}" -overwrite_original D:\Bilder\X_Metadaten\*.jpg
Title: Re: Placeholder in keyword-search possible?
Post by: Birdman on March 07, 2021, 03:34:30 AM
So easy, thanks for the advice! For one "Umlaut" there have to be even two dots, so "Gew..sser" worked.

If working in Windows and for my understanding: when looking for a "real" dot instead of a placeholder, this has to masked? Like searching for "End of sentence. New sentence" would be something like "End of sentence%%.%% New sentence"?
Title: Re: Placeholder in keyword-search possible?
Post by: Phil Harvey on March 07, 2021, 07:16:47 AM
To look for a real "." use "\." in the regular expression.

- Phil