I need to write a C# Program to convert dynamic complex nested json file to CSV. I cant use ChoETL or CSVHelper libraries only can use NewtonSoft .Json .
I have tried to convert the json object into flatenned object
var fobj=JObject.Parse(jsonobj).
Descendents().OFType<JValue>().
ToDictionary(jv=>jv.Path ,jv=>jv.ToString());
But writing the fobj dictionary to CSV will not give the expected output.
Is there anyway we can convert nested dynamic json to CSV ?