Skip to Content
author's profile photo
Former Member

Remove following characters " \ , # from field and Replace with Space

Dear Team,

This is basically IDOC-FILE(.csv) conversion.

'MATNR' field populates with following special characters which has to be replaced with space.

, # \ "

Please help on this. Thank you very much in advance.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Sep 22, 2016 at 07:21 PM

    Hi Rajesh,

    Easiest way to maintain it by using mapping function replaceString.

    As we are facing illegal escape character issue while using replaceAll in UDF.

    Thanks

    Sagarika


    Capture1.PNG (26.6 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 22, 2016 at 04:45 PM

    Hello Rajesh,

    Try the below code

    String Out= Input.replaceAll("[#\]","");

    return Out;

    add all the required special characters in the square braces

    If you will get only # \ then you can use normal mapping functions like replace string and achieve it.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 22, 2016 at 04:40 PM

    Try this :

    return var1.replaceAll("[^a-zA-Z0-9]","");
    

    This will replace all the special characters.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded