photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Aubrey on October 06, 2019, 01:00:34 PM

Title: Replacing tilde
Post by: Aubrey on October 06, 2019, 01:00:34 PM
Quick one: yes/no! If no then I'll figure it out with regex.

Is there an escape sequence to replace tilde (~)

for example:
{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|replace:~Where|==}

I'm always left with residual "~"
I've tried \~ and ~~ without success.
Title: Re: Replacing tilde
Post by: Mario on October 06, 2019, 01:30:52 PM
No. Unfortunately you have picked the only escape character available to IMatch variables as part of your keywords. There is no escape for this escape.
~ means in variables: Interpret the following character literally, ignoring any special meanings. So, ~; means: "Ignore the special meaning of ; and just place a ; in the text" => ~; becomes ;
You are trying to escape ~~, which of course results in ~ being emitted.
Title: Re: Replacing tilde
Post by: Aubrey on October 06, 2019, 03:40:16 PM
Hmmm, looks like I'm out of luck  ??? I've tried a few workarounds, length substr etc. Problem is I cannot embed "length" in "substr"

I think I'll just live with what I have! I know I could change ~Where to 1_Where, or some such; then keywords need to be written back to files.

Any features in 2020 that may allow me to remove ~ ?

Aubrey.
Title: Re: Replacing tilde
Post by: Mario on October 06, 2019, 04:01:09 PM
Just use the Metadata Mechanic app.

(https://www.photools.com/community/index.php?action=dlattach;topic=9406.0;attach=22523;image)