11-15-2023 01:38 PM - last edited on 11-15-2023 03:03 PM by dmiller
Hello,
I have a requirement where a text with "," delimiter has to be generated into rows.
For Example a string or text $src_name = "AMK, ACK, AGK, ABK" should be generated as following rows.
The output should be separate rows as below.
AMK
ACK
AGK
ABK
I tried using the Group by N with group size set to 0 and then use the expression "group.split(‘,’) " in the mapper following the Group by N as below. I am getting error and not able to find a way to solve this.
Any help is appreciated.
Thanks
Aravind N
Solved! Go to Solution.
11-16-2023 12:51 AM - edited 11-16-2023 12:55 AM
1) First try to split the string by "," - and as an output you will receive array of records:
("AMK,ACK,AGK,ABK").split(',')
output: ["AMK","ACK","AGK","ABK"]
2) Then split the array, using JSON Splitter Snap.
BR,
Spiro Taleski
11-16-2023 12:51 AM - edited 11-16-2023 12:55 AM
1) First try to split the string by "," - and as an output you will receive array of records:
("AMK,ACK,AGK,ABK").split(',')
output: ["AMK","ACK","AGK","ABK"]
2) Then split the array, using JSON Splitter Snap.
BR,
Spiro Taleski
11-19-2023 07:50 PM
This worked well. Thank you.
Also, Is it possible if this can be achieved in a single mapper expression without using the splitter.