6 Replies Latest reply: Aug 5, 2014 12:09 PM by Ajay Krishnan Prabhakaran RSS

    Generating blank spaces based on field value length

    Sudeep Mahapatra

      Hi,

      I've a table like below

      sample:

      load * Inline [

      id,name

      1,abc

      2,abcd

      3,abcde

      4,abcdef

      ];

       

      I'm looking for a solution using which I would be able to create another field which will have spaces[' '] based on the length of the field 'name'. for example the table with the new field (fieldlen) should look like below

      id,name,fieldlen

      1, abc, '   '

      2, abcd, '    '

      3, abcde, '     '

      4, abcdef, '      '

      for id = 1 the fieldlen value should be 3 spaces and for id=2 the fieldlen value should be 4 spaces and so on.

      Thanks in advance.

       

      Thanks and Regards,

      Sudeep