Author Topic: Replacing tilde  (Read 129 times)

Aubrey

  • Super Hero
  • ****
  • Posts: 1043
  • IMatch user since June 2008
Replacing tilde
« 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.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23174
Re: Replacing tilde
« Reply #1 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.

Aubrey

  • Super Hero
  • ****
  • Posts: 1043
  • IMatch user since June 2008
Re: Replacing tilde
« Reply #2 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.
« Last Edit: October 06, 2019, 03:48:59 PM by Aubrey »

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23174
Re: Replacing tilde
« Reply #3 on: October 06, 2019, 04:01:09 PM »
Just use the Metadata Mechanic app.