Page 1 of 1

Filtering non alphanumeric charaters

Posted: Mon Dec 06, 2004 10:00 am
by kudaka
Hello!
How to filter all non-alphanumeric charaters from a srting. (filter space,/,-,* etc).
Is there a option in oconv function for this? or any other transformation function available for this?

Input string:
'SY-002-1|SALINAS-E Boronda Rd/San'
Result:
'SY0021SALINASEBorondaRdSan'

Thank you

Posted: Mon Dec 06, 2004 11:15 am
by chucksmith
Look at the Convert() function

Posted: Mon Dec 06, 2004 12:05 pm
by kcbland
CHANGE, EREPLACE, CONVERT

Posted: Tue Dec 07, 2004 3:11 am
by garthmac
If you want to use Oconv, create your own routine using:

Ans = Oconv(Arg1, "MCA")

Posted: Tue Dec 07, 2004 8:27 am
by chulett
:? No need to do that, there's already a built-in Transform for that - it's called LETTERS. Note that there is also what is basically the opposite called DIGITS that uses "MCN".

Posted: Wed Dec 08, 2004 6:21 pm
by kudaka
I used convert function. It works. But, we need to list all the unwanted characters.

FYI:
Becuase I need ALPHA and DIGITS (alpha numerics), we can not use the 'MCA' or 'MCN' formats with Oconv. Same with "LETTERS" and "DIGITS" built-in transforms.

thanks for all the help.

Posted: Wed Dec 08, 2004 7:02 pm
by rasi
Hi

To get the non-alpha and non-numbers use the MCA and MCN function twice.

Oconv(Oconv('String','MC/N'),'MC/A')

Best of luck

Thanks

Posted: Wed Dec 08, 2004 7:08 pm
by ray.wurlod
So, to keep all the alphanumerics, use that result and convert to "".

Code: Select all

Convert(Oconv(Oconv(MyString,'MC/N'),'MC/A'), "", MyString)