Page 1 of 1
using sandr to replace a special chracter
Posted: Tue Jul 21, 2009 10:19 am
by gaurav.shetti
I wanted to replace a "$$" sign in a given text with a blank space.
Eg
<$x="zdvzj$$czxCBz$$mzxncmnc">
<sandr "$$" " " $x><$x=$ret>
this above case does not work for $ as it is a special char.
Which is the escape sequence that I can use for the above case.
using sandr to replace a special chracter
Posted: Tue Jul 21, 2009 10:49 am
by mark
$ is special. $$ gives one $ so $$$$ will give 2 $.
<sandr "$$$$" " " $x>
using sandr to replace a special chracter
Posted: Tue Jul 21, 2009 11:09 am
by gaurav.shetti
but still the $$ does not get replaced by blank...
there should be some escape sequence to replace $$ as it is.
this is what I am doin:
cdi_location_name: $cdi_location_name
<sandr "$$$$" " " $cdi_location_name><$cdi_location_name=$ret>
cdi_location_name: $cdi_location_name
this is the output:
cdi_location_name: 950 Forrer Blvd$$Kettering$$OH$$45420-1469$$US
cdi_location_name: 950 Forrer Blvd$$Kettering$$OH$$45420-1469$$US
Do you see it does not replace those dolar signs witht a blank..
using sandr to replace a special chracter
Posted: Tue Jul 21, 2009 11:49 am
by mark
My bad. I forgot that $ is special in REX too. Add backslashes for REX:
<sandr "\$$\$$" " " $x>
Or use hex:
<sandr "\x24\x24" " " $x>
using sandr to replace a special chracter
Posted: Tue Jul 21, 2009 12:59 pm
by gaurav.shetti
yeah this works great..
Thanks