1 Reply Latest reply: Jan 17, 2014 10:54 AM by Gysbert Wassenaar RSS

    Adding one char (3) to to each char in a string

    Srikanth P

      Hi All, I need to create the new field based on existing field. I need to add 3 to each number in a field.

       

      for ex:

      Field --> NewField

      325 --> 333235

      A3C  --> 3A333C

      4518 --> 34353138

       

      I achieved this script. But the script took longer times to load

       

      T:

      LOAD * INLINE [

      ID

      325

      43534

      78204

      A3C

      ] ;

       

      LOAD ID , Concat(HID , '' , S) AS HID

      Group BY ID;

      LOAD ID , 3& Mid(ID , IterNo() ,1) AS HID , IterNo() AS S

      Resident T While IterNo() <= Len(ID) ;

       

      But this small piece of code took longer times.

       

      So there any other way to achieve this with lower reload time.