on 01-21-2015 3:36 AM
Hi Gurus
source :
S1
Item1 : 123
Item2: ABC
Item3: 0000
S2
Item1 : 123
Item2: XYZ
Item3: 0000
S3
Item1 : 123456
Item2: YYYY
Item3: 0000
Have to delete duplicate segment based on the Item.
expected target:
Header 1
Item1 : 123 - ------------------>from S2 segment (S1 should not come because Item1 is same for S1 and S2)
Item2: XYZ
Item3: 0000
Header 2
Item1 : 123456
Item2: YYYY
Item3: 0000
Thank for help gurus.
Regards,
Jittu
Jittu,
Please write UDF with below logic. Input is item1 queue/context.
LinkedHashSet<String> uniqueSet = new LinkedHashSet(Arrays.asList(item1));
String[] uniqueArray = uniqueSet.toArray(new String[uniqueSet.size()]);
for (int i = 0; i < uniqueArray.length; i++) {
result.addValue(uniqueArray[i])
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.