Single column with multiple rows should be converted into single row with commas

Can any one help....
Source is.....
a
b
c
d
want target as.....
a,b,c,d
thanks in advance

Questions by sai3689   answers by sai3689

Showing Answers 1 - 12 of 12 Answers

vasuu

  • Apr 13th, 2015
 

uses pivot stage or u can tx by stage variables

  Was this answer useful?  Yes

amulya kumar panda

  • Apr 17th, 2015
 

add one extra column that value 1 or any thing but value same
Use a vertical Pivot option available in Pivot Enterprise stage(Stage tab-->Properties-->Pivot Type=Vertical)
Again in stage-->Pivot properties tab-->group by on extra column and Pivot using source column.
Then select array size= as your value.

preeti

  • Aug 9th, 2017
 

You can create a other array with some size and insert data in single array from double array for more see the following code



for(int i=0;i {
System.out.print(a1[i]);
}
}

}

Code
  1. class TestClass{

  2.           public static void main(String l[])

  3.           {

  4.                   int [][]a={{1},{2},{3},{4},{5}};

  5.                   int a1[]=new int[6];

  6.                   int k=0;

  7.                   for(int i=0;i<a.length;i++)

  8.                   {

  9.                           for(int j=0;j<a[i].length;j++)

  10.                           {

  11.                                  

  12.                                

  13.                                   a1[k]=a[i][j];

  14.                                   k++;

  15.                                 System.out.println(a[i][j]);

  16.                           }

  17.                          

  18.                   }

  19.                  

  20.          

  21.        

  22.  for(int i=0;i<a1.length;i++)

  23.  {

  24.         System.out.print(a1[i]);

  25.  }

  26.           }

  27.  

  28.  }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions