I'm trying to combine multiple JSON objects into one JSON array and maybe filter on the name of the data (temperature, pressure, altitude).
I tried to use JSON-Simple and Java but I can't get it to work.
Here are the pieces of JSON:
The input I want to convert:
{"temperature" : -12, "sendtimes" : 10000}
{"pressure" : 1000, "sendtimes" : 10001}
{"altitude" : 100.7, "sendtimes" : 10002}`
How I want it after conversion:
{
"temperaturData": [
{"temperature": -12, "sendtimes": 10000},
{"pressure" : 1000, "sendtimes" : 10001},
{"altitude" : 100.7, "sendtimes" : 10002},
]
}
I have no clue on how to do this, thanks to everyone who can help me!
{}or[]? Is this{"temperature" : -12, "sendtimes" : 10000}in a single line and all other individual{}enclosed data in single lines?