6 Replies Latest reply: Mar 23, 2017 11:35 AM by S Satti RSS

    Rename string containing specific characters

    Supriya R

      Hi,

       

      i have a string, and i need to check whether that string contains specific strings and rename it.

       

      StringName                                                                         Renamed_string

       

      FTC MNC and CC refund_23-03-2017_29-03-2017            MNC and CC

      NC-MNC_23-03-2017_29-03-2017                                    MNC

      Y MNC and CC_23-03-2017_29-03-2017                           MNC and CC

      WRTE MNC_23-03-2017_29-03-2017                               MNC

      WRTE MNC and CC_23-03-2017_29-03-2017                  MNC and CC

      MNC_23-03-2017_29-03-2017                                         MNC

      Y-MNC & CC_23-03-2017_29-03-2017                             MNC and CC

      MNC refund_23-03-2017_29-03-2017                               MNC

      MNC & CC_23-03-2017_29-03-2017                                MNC and CC

      MNC_23-03-2017_29-03-2017                                         MNC

      MNCCC_23-03-2017_29-03-2017                                   MNC and CC

      CC_23-03-2017_29-03-2017                                            CC

       

      If in given string it contains only MNC, i need renamed string to be MNC.

      If it contains both MNC and CC, i need to rename string as MNC and CC.

       

      This renamed string is to added as onemore column to table.

       

      Script;

      Load  StringName;

      SQL SELECT  StringName

      from MyTable;

       

       

      How could i do this?.