Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Remove spl characters

Hi All,

How to remove below special characters from  backend and frontend .

*1415*4052
*4372
`
``
``AH030910WPI00906
`AH030809WPI00578
`SU020708WIN00999
`TT021213WIN00795
`TT030708WIN01021
`TT031011WPI01399
~~

thanks

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Keepchar()

Example: KeepChar(DimName, '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')

-- If you want to retain only numbers and alphabets.

Or Purgechar()

Example: Purgechar(DimName, '*~')

-- This will remove * and ~ from your dimension value.

Hope this helps you.

Regards,

Jagan.

View solution in original post

11 Replies
prma7799
Master III
Master III
Author

any idea...

Not applicable

hi Prashantbi,

Try using Apply map and MapSubString.

Please let me know if u need help on this.

Regards,

Pavan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Keepchar()

Example: KeepChar(DimName, '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')

-- If you want to retain only numbers and alphabets.

Or Purgechar()

Example: Purgechar(DimName, '*~')

-- This will remove * and ~ from your dimension value.

Hope this helps you.

Regards,

Jagan.

its_anandrjs

Hi,

Try Purgechar or Keepchar

Ex:-

LOAD PurgeChar(Chars,'*`~' ) as NewChar,*;
LOAD * Inline
[
Chars
*1415*4052
*4372
`
``
``AH030910WPI00906
`AH030809WPI00578
`SU020708WIN00999
`TT021213WIN00795
`TT030708WIN01021
`TT031011WPI01399
~~

];

Regards

Anand

prma7799
Master III
Master III
Author

Hi Anand,

I want to remove ' '' this character also

Thanks

Prashant

jagan
Luminary Alumni
Luminary Alumni

Hi Prashant,

Then try like this

=Purgechar(DimName, '*~' & chr(39))


Hope this helps you.


Regards,

Jagan.

its_anandrjs

Hi,

Then use ascii char of the character and use CHR() function in transformation step 

Ex:-

LOAD *,PurgeChar(SecondPurgeChar,Chr(34)) as ThirdPurgechar;
LOAD *,PurgeChar(NewChar,Chr(96)) as SecondPurgeChar;
LOAD
PurgeChar(Chars,'*`~' ) as NewChar,*;
LOAD * Inline
[
Chars
*1415*4052
*4372
`
``
``AH030910WPI00906
`AH030809WPI00578
`SU020708WIN00999
"
""
,
`TT021213WIN00795
`TT030708WIN01021
`TT031011WPI01399
~~

];



Regards

Anand

deepakqlikview_123
Specialist
Specialist

Use string functions.


prma7799
Master III
Master III
Author

Hi Jagan,

I used

=PurgeChar(INVC_LABEL,'~*`''')

but now I want that remove any special character from the above mean in future user insert data with another spl character then what will I do..

Thanks

Prashant