I am trying to convert an excel file with two columns into a Json file. However, I want to keep the hierarchy as well some how. For example from the excel file below, I want the json to form a hierarchy in such a way that "Charles Johnson" is the root value, and the size associated to him is 5395. Similarly, in the second row, "Donald Williams" works under "Charles Johnson" and the size for him is 3057. And so on, the last name in each row of the file connects it to its parent nodes. And i want to use the .split(-) function I have been stuck at this for quite a while till i finally gave up:/ Any help would be greatly appreciated :)
Charles Johnson 4184 Charles Johnson-Donald Williams 8385 Charles Johnson-Donald Williams-Daniel Fertig 428 Charles Johnson-Donald Williams-Daniel Fertig-Lino Walling 1091 Charles Johnson-Donald Williams-Daniel Fertig-Lino Walling-Jim Cooke 318 Desired Output Type:
{ "name": "flare", "children": [{ "name": "analytics", "children": [{ "name": "cluster", "children": [{ "name": "AgglomerativeCluster", "size": 3938 }, { "name": "CommunityStructure", "size": 3812 }, { "name": "HierarchicalCluster", "size": 6714 }, { "name": "MergeEdge", "size": 743 }] } }]] }