web stats
Mirth Community - View Single Post - CSV into JSON !
Thread: CSV into JSON !
View Single Post
  #1  
Old 04-05-2019, 08:42 AM
gojoshi gojoshi is offline
OBX.1 Kenobi
 
Join Date: Jul 2013
Posts: 36
gojoshi is on a distinguished road
Default CSV into JSON !

Hi All,

I need to turn a csv message into JSON. What I'm stuck with is the repeating values in the CSV that need to be turned into repeating values in the JSON.
For example, the below CSV:
Monday,Apples;Oranges;Peaches;Mangoes,
Needs to be turned into the below JSON:
{
"Day": "Monday",
"Fruits": [{"Fruit1":"Apples","Fruit2":"Oranges","Fruit3":"Pe aches", "Fruit4":"Mangoes"}]
}

Any help would be greatly appreciated!
Reply With Quote