I'm trying to figure out how to count different values in a VERY large JSON file.
Below I have included a very small portion of my 10,000+ lines JSON file. I need to count the total amount of "status":"booked" and "status":"free" in number form.
[
{
"eventId": 126363,
"eventKey": "4749466",
"objectLabelOrUuid": "uuid8083",
"status": "booked",
"quantity": 1,
"ticketType": null,
"holdTokenHash": null,
"version": 3,
"extraData": null
},
{
"eventId": 126363,
"eventKey": "4749466",
"objectLabelOrUuid": "uuid11392",
"status": "free",
"quantity": 0,
"ticketType": null,
"holdTokenHash": null,
"version": 6,
"extraData": null
},
{
"eventId": 126363,
"eventKey": "4749466",
"objectLabelOrUuid": "uuid8051",
"status": "booked",
"quantity": 1,
"ticketType": null,
"holdTokenHash": null,
"version": 2,
"extraData": null
}
]
After converting them to number form i will be placing the values in an html document
Seats Booked: <a id="booked"></a> Seats Free: <a id="free"></a>
expected output:
Seats Booked: 2 Seats Free: 1
It is my understanding that i can use a foreach method to fetch the data but i am unable to count them. If you have ANY ideas or preferably documentation that you can link here just let me know here!