using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
public static void Main()
var dt = Tabulate(GetJson());
foreach (DataRow row in dt.Rows)
foreach (DataColumn col in dt.Columns)
Console.WriteLine(col.ColumnName + ": " + row[col]);
Console.WriteLine(new string('-', 30));
public static DataTable Tabulate(string jsonContent)
var jsonLinq = JObject.Parse(jsonContent);
var arrayProp = jsonLinq.Properties().First(p => p.Value is JArray);
var srcArray = (JArray)arrayProp.Value;
var regex = new Regex($@"^{arrayProp.Name}\[\d+\]\.");
var trgArray = new JArray(
srcArray.Children<JObject>()
.Select(row => new JObject(
.Where(p => p.Value is JValue)
.Select(p => new JProperty(
regex.Replace(p.Value.Path, "").Replace(".", "_"),
DataTable dt = trgArray.ToObject<DataTable>();
private static string GetJson()
""last-changed-on"": ""2019-01-03T11:46:14Z"",
""created-on"": ""2018-12-12T10:04:47Z"",
""privacyEnabled"": false,
""replyByEmailEnabled"": true,
""harvest-timers-enabled"": false,
""overview-start-page"": ""default"",
""start-page"": ""projectoverview"",
""foldername"": ""root"",
""microsoftConnectors"": {
""foldername"": ""root"",
""notifyeveryone"": false,
""filesAutoNewVersion"": false,
""defaultPrivacy"": ""open"",
""tasks-start-page"": ""default"",
""announcementHTML"": """",
""isProjectAdmin"": true,
""name"": ""MCG Company""
""show-announcement"": false,
""subStatus"": ""current"",
""type2"": {""tt"":""arlington2""},
""file_110620221120.jpg""
""policyExpirationDate"": """"
""last-changed-on"": ""2018-12-11T17:52:57Z"",
""created-on"": ""2018-11-26T11:11:00Z"",
""privacyEnabled"": false,
""replyByEmailEnabled"": true,
""harvest-timers-enabled"": false,
""overview-start-page"": ""default"",
""start-page"": ""projectoverview"",
""foldername"": ""root"",
""microsoftConnectors"": {
""foldername"": ""root"",
""notifyeveryone"": false,
""filesAutoNewVersion"": false,
""defaultPrivacy"": ""open"",
""tasks-start-page"": ""default"",
""announcementHTML"": """",
""isProjectAdmin"": true,
""name"": ""Project One"",
""name"": ""MCG Company""
""show-announcement"": false,
""subStatus"": ""current"",