I want to write a program to convert the json to CSV
But it has problem to convert CSV because I have the column name including an array, when I use my function to convert, it has the problem
For example:
Here is my json that want to convert:

```
{  
   "ref":"ABC123456",
   "pickcompname":"ABC Company",
   "gw":123.45,
   "packaing":[  
      {  
         "qty":5,
         "unit":"C",

      },
      {  
         "qty":7,
         "unit":"L",

      }
   ]
}

```

But I want to make the Packaing can convert the column name such as qty1,unit1,qty2,unit2, Unfortunately, it only output:

```
"ref",
"pickcompname",
"gw",
"commoditytype",
"packaing""ABC123456",
"ABC Company",
"123.45",
"D",
"[
    {
        "qty":5,
        "unit":"C"
    },
    {  
    "qty":7,
    "unit":"L",
    }
]"

```

How to I modify it and Here is my C# code:

```
    public string JsonToCsv3(string jsonContent, string delimiter)
    {

        var data = jsonStringToTable(jsonContent);
        var headers = ((IEnumerable<dynamic>)((IEnumerable<dynamic>)data).First()).Select((prop) => prop.Name).ToArray();
        var csvList = new List<string> 
        {
            string.Join(delimiter, headers.Select((prop) => string.Format(@"""{0}""", prop)).ToArray())
        };

        var lines = ((IEnumerable<dynamic>)data)
            .Select(row => row)
            .Cast<IEnumerable<dynamic>>()
            .Select((instance) => string.Join(delimiter, instance.Select((v) => string.Format(@"""{0}""", v.Value))))
            .ToArray();

        csvList.AddRange(lines);
        return string.Join(Environment.NewLine, csvList );
    }

    static private dynamic jsonStringToTable(string jsonContent)
    {
        var json = jsonContent.Split(new[] { '=' }).Last();
        return JsonConvert.DeserializeObject<dynamic>(json);
    }

    static private IEnumerable<T> jsonStringToTable<T>(string jsonContent) where T : class
    {
        var json = jsonContent.Split(new[] { '=' }).Last();
        return JsonConvert.DeserializeObject<IEnumerable<T>>(json);
    }

```