1

In an attempt to not waste time, I was hoping someone here could readily identify the data structure presented below and if so, could you please tell me what it's called and where I might find an existent parser?

CumulativeData = {
    ["UnitedStates"] = {
        ["California"] = {
            [0] = {
                "777",
            },
            ["Flower"] = "Tulip",
            ["PoliticalAffiliation"] = 2,
            ["ZipCodes"] = {
                [0] = "35415",
                [1] = "54178",
                [2] = "65214",
                [3] = "58795",
            },
        },
        ["Wyoming"] = {
            [0] = {
                "888",
            },
            ["Flower"] = "Rose",
            ["PoliticalAffiliation"] = 1,
            ["ZipCodes"] = {
                [0] = "96325",
                [1] = "14685",
                    [2] = "52365",
                [3] = "85471",
            },
        },
    },
}
Kulingar
  • 941
  • 3
  • 14
  • 30

1 Answers1

0

Json.NET is a good phaser for JSON Data.

Good starting point is here. Json data structure can be very dynamic. You can access each entity as dynamic property of a class. See example here

Community
  • 1
  • 1
Jeyara
  • 2,198
  • 1
  • 23
  • 26
  • Thanks for the attempted answer, but the above Data Structure isn't JSON, I had only mentioned JSON to explain how I wrote my own parser for JSON because I didn't know there were so many. – Kulingar Oct 14 '13 at 04:23
  • I see, perhaps this is JSON after all? I will mess with this parser and see if it works to parse this I had always seen JSON with :'s seperating key / value (not =) and never with []'s around them. – Kulingar Oct 14 '13 at 04:29
  • Since its slimier to JSON, workaround would be if you could find/write a translation or conversion from above data structure to JSON. Then it would give lot of flexibility. Converting = with : etc. – Jeyara Oct 14 '13 at 04:36