I have a JSON file that I would like to create an multi-dimensional array from. This information is stored in a JSON file.
Here is the JSON data.
{
"table": {
"columnNames": ["column1", "column2", "column3", "column4"],
"columnTypes": ["String", "String", "String", "String"],
"rows": [
["data00", "data01", "data02", "data03"],
["data10", "data11", "data12", "data13"],
["data20", "data21", "data22", "data23"],
["data30", "data31", "data32", "data33"]
]
}
}
I need to create an array of arrays from the objects in the “rows” section.
Any help would be appreciated!
Thanks!!!
Once you parse the JSON, the “table.rows” property will already be a multi-dimensional array (2 dimensions, to be specific). All you have to do is access it:
As to parsing, you should probably use something like Crockford’s parser: