Having a scenario that source data like below in table
Target Output required as
You can use the Java code in this example to create and compile an active Java transformation
Create a java transformation with one input and one output field as shown in below snapshot.
Connect concatenated fields (A#B#C) from expression transformation to FLD_INPUT of java transformation
Now go to java code tab and paste below code
String[] str_fld_nm=FLD_INPUT.split("#");
for(inti=0; i < str_fld_nm.lenght; i++){
FLD_OUTPUT =str_fld_nm[i];
generateRow();
}
It is using java functionality of array to break input field and multiple fields and then use generateRow () to produce multiple rows.
Now connect FLD_OUTPUT to target, so output will be as shown below.
Core functionality is using Java functionality, to break concatenated string into multiple fields and use generateRow() to produce multiple rows.
By using Router & Normalizer transformations also we can convert rows into columns.