Hi,
I am trying to normalise street names by removing any dots. So far I have been unable to get the subst function to do what I want. The problem seems to be getting the dot to be taken literally in the subst parameters.
I have tried:
a) set newname='${name|subst:. +=> }'
b) set newname='${name|subst:\. +=> }'
c) set newname='${name|subst:[.] +=> }'
All of the above seem to have no effect, i.e. newname ends up the same as name.
I am thinking of doing it in two stages: firstly replacing ". " (dot followed by space) with a space, and then replacing any other dots with a space so "A.B. Street" ends up as "A B Street". I could also do it by replacing any dots by spaces and then compressing multiple spaces. But in both cases I need subst to match a literal dot.
My current style rules look like this:
highway=* & name ~ '.*[.].*' {set newname='${name|subst:\. +=> }'}
newname=* {echo "dots changed from ${name} to ${newname} (1)"; set name='${newname}'}
highway=* & name ~ '.*[.].*' {set newname='${name|subst:[.]=> }'}
newname=* {echo "dots changed from ${name} to ${newname} (2)"; set name='${newname}'}
Can anyone help please?
Colin