I have a JSON object as below
{
"a" : "ABCDEFGHIJKL",
"b" : "B"
}
here each field contains a string (all are of different sizes), I need to divide each field value (i.e string) by 4 and then make it a separate JSON object array and assigned it to a new field So my expected o/p here is as below
[{
"label": "a",
"value": [{
"Line": "ABCD"
},
{
"Line": "EFGH"
},
{
"Line": "IJKL"
}
]
},
{
"label": "b",
"value": [{
"Line": "B"
}]
}
]
I am using mule4, I tried to use some function of Dataweave but still no luck