Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Comma delimited list to rows?

What I need to do is pretty straight-forward. Each input row has two columns: an identifier and a comma delimited list of values. The list of values has a variable number of values. For each value in that list I need to output a row along with the associated identifier. Example:
INPUT
S12345|2,3,4,5,6
S9865|9,8,7
OUTPUT:
S12345|2
S12345|3
S12345|4
S12345|5
S12345|6
S9865|9
S9865|8
S9865|7
I tried the code below in a tJavaRow but it seems that component can only output one row of output per row of input:
String[] gradesArray = input_row.Grades.split(",");
for (int i = 0; i < gradesArray.length; i++) {
output_row.SchoolID = input_row.SchoolIdentifier;
output_row.Grade = gradesArray;
}

Any ideas or suggestions?
Thanks.
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I was able to do this with a minimum of effort using a tNormalize component.

View solution in original post

1 Reply
Anonymous
Not applicable
Author

I was able to do this with a minimum of effort using a tNormalize component.