using sandr to replace a special chracter

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

using sandr to replace a special chracter

Post 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.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

using sandr to replace a special chracter

Post by mark »

$ is special. $$ gives one $ so $$$$ will give 2 $.
<sandr "$$$$" " " $x>
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

using sandr to replace a special chracter

Post 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..
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

using sandr to replace a special chracter

Post 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>
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

using sandr to replace a special chracter

Post by gaurav.shetti »

yeah this works great..
Thanks
Post Reply