How do I remove special characters from a string /numeric datatype?

TECHNO

Active Member
Hi,
I am trying to remove special charcaters from a string from text file.

ex: ********152.00
****62.00
date "10-12-10"
I want the out as 152.00,62.00 and 101210.

Thanks,
 
You can try the compressed description business function. I am not sure which characters it eliminates. But, if that doesn't work this is a simple programming thing. Parse the the string, keep the characters you want, discard the ones you don't. Can probably be done in less than 10 lines of code, even in NER.
 
Techno,

Two ways...

- ltrim(rtrim(fieldname,'*'),'*') will trim all the '*' characters from the beginning and end of the field
- The function "Find a Character in a String" will return the location of a specified character. You can then Substring out that character by appending a substring of what was before that location to what is after that location.

Anyone Else?

(db)
 
Techno,

One more thing - pleas place your system configuration in the footer of you profile (so we always know what you are really asking for)...

(db)
 
Hi Daniel,
I was using the same functions but I hadnt used '*' thats it was not accepting the second parameter.Thanks alot for the help.

************
E812 on 10g/windowsXP
 
Techno,

I take it that, the trims with splats are a success for the first half of the issue?

grin.gif


(db)
 
Or perhaps easier: use business function B0800780 (StripSpecialsCharsFromString).

regards,
Walter
 
Hi,

you could create new function to remove your unwanted charater starting from "Remove illegal char from a string"(B1702080).
This one remove only CR and LF, you have only
to add a list of char in the "if" statement.

Stefano
 
uncessary to say but, if you need is to have only number and decimal separator the new BSFN has to remove all
char except those one.
(with B1702080 function you don't have to strip blanks char)
 
Back
Top Bottom