I have a text file containing a an array of objects in the following format:
[{
"symbol": "MSFT",
"side": "BUY",
"price": 120,
"quantity": 100
},
{
"symbol": "KPMG",
"side": "SELL",
"price": 88,
"quantity": 10
}]
However, when I upload the file into my application, and store it as a variable, it gets stored as a string. Does anyone know how I can avoid doing this?
I want to be able to read the file in (which I can already do) and store that as an array. So I can go like data[1] and get access to
{
"symbol": "KPMG",
"side": "SELL",
"price": 88,
"quantity": 10
}
I also want to be able to go like:
data[1].side
and retrieve the field