If I have a sample json like this and I want to use choETL to convert json to csv, how do i write both arrays to one file?
{
"Id": "123456",
"Request": [
{
"firstName": "A",
"lastName": "B",
}
],
"Response": [
{
"SId": "123"
}
]
}
Csv file should be something like Id,firstName,lastName,SId 123456,A,B,123
Here is how you can produce the expected CSV from the json by using ChoETL
Output:
Sample fiddle: https://dotnetfiddle.net/CnBX3C
UPDATE:
If the array is dynamic, here is one way to produce the CSV output by
Request
json array fieldSample JSON:
Here is the code to parse the json by
Request
json array fieldOutput:
Sample fiddle: https://dotnetfiddle.net/CnBX3C