Converting a normalized CSV to complex JSON Object

One Star

Converting a normalized CSV to complex JSON Object

Hi,
i searched quite a bit but did not find any solution. I'm facing the issue that i have a normalized CSV File which is exploded in all relations. Out of that file i try to reconstruct some relations and build a complex json object. 
As an example it is a structure similar to a picture metainformation with persons and tags. The csv would look similar to the following lines
Picture name;Person;Tag
pic1;PersonA;sea
pic1;PersonB;sea
pic1;PersonA;sun
pic1;PersonB;sun
pic2;PersonC;bird
pic3;PersonA;bird
pic3;PersonC;bird
I would like to build up the folowing JSON Object from that kind of data (not sure if it is completely valid but should be sufficient to get the idea):
"pictures": ,
"tags":
}
},
"picture": {
"name": "pic2",
"persons": ,
"tags":
}
},
"picture": {
"name": "pic3",
"persons": ,
"tags":
}
}]

Does anybody have an idea on how to solve that? It seems not doable through the WriteJSONField directly. I'm pretty open to the suggestions and ideas. The only thing i have almost no influence on is the incoming csv file. So for myself starting point is the csv i provided. 
Regards and thx in advance
COnstantin
Community Manager

Re: Converting a normalized CSV to complex JSON Object

Hi 
It is impossible to generate this json object with tWriteJsonField, because tWriteJsonField don't allow to define multiple loop elements, this json object has two loop elements: person and tag.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business