Recompose a JSON file

Hello everyone,
I have a json file stored in an sd card. The problem is that this json file is very badly composed. I try to recompose it to finally have a json file that looks like this:

{
  "44.23;7.02": [
    {
      "altitude": 250.50,
      "06:00": [
        {
          "pressure": 99051, 
          "temperature": 289.5 
        }
      ],
      "07:00": [
        {
          "pressure": 98003, 
          "temperature": 290 
        }
      ]
    }
  ],
  "44.23;7.03": [
    {
      "altitude": 280.70,
      "06:00": [
        {
          "pressure": 99100, 
          "temperature": 290 
        }
      ],
      "07:00": [
        {
          "pressure": 92010, 
          "temperature": 288.6 
        }
      ]
    }
  ]
}

(this is an excerpt, there will be many more points and hours)
The json file doesn't have the correct syntax, but that's for example.

I manage to create a json file which contains the point objects (coordinates) with a random altitude. But then I can't add the real altitudes, nor the hours...
Basically, once the file is created as in the following code, it cannot be modified.

#include <SPI.h>
#include <SD.h>
#include <ArduinoJson.h>

File dataFile;

int i=1;
byte nx;
byte ny;

int start;
int end;

void setup() {
   Serial.begin(9600);
   while (!Serial) {}


}

void loop() {
   if(i==1){
         if (!SD.begin(SS)) {
     Serial.println("SD card initialization error.");
     return;
   }
  
   dataFile = SD.open("/altjson.txt", FILE_READ);
   if (!dataFile) {
     Serial.println("Error opening file.");
     return;
   }
  
   String unit = "";
   float lo1=0.0;
   float la1=0.0;
  
   while (dataFile. available()) {
     String line = dataFile.readStringUntil('\n');
     int index = line.indexOf("parameterUnit\":");
     if (index != -1) {
       start = index + 16; // unit start index
       end = line.indexOf('"', start); // end index of unit
       unit = line.substring(start, end);
     }
     int index2 = line.indexOf("lo1\":");
     if (index2 != -1) {
       start = index2 + 5;
       end = line.indexOf(',', start);
       lo1 = line.substring(start, end).toFloat();
     }
     int index3 = line.indexOf("la1\":");
     if (index3 != -1) {
       start = index3 + 5;
       end = line.indexOf(',', start);
       la1 = line.substring(start, end).toFloat();
     }
     int index4 = line.indexOf("nx\":");
     if (index4 != -1) {
       start = index4 + 4;
       end = line.indexOf(',', start);
       nx = line.substring(start, end).toFloat();
     }
     int index5 = line.indexOf("ny\":");
     if (index5 != -1) {
       start = index5 + 4;
       end = line.indexOf(',', start);
       ny = line.substring(start, end).toFloat();
     }
   }
   Serial.println("Parameter unit: " + unit);
   Serial.println("Value of lo1: " + String(lo1));
   Serial.println("Value of la1: " + String(la1));
   Serial.println("Value of nx: " + String(nx));
   Serial.println("Value of ny: " + String(ny));


DynamicJsonDocument doc(4096);
   JsonArray datameteo = doc.createNestedArray("datameteo");
  
   float la = la1;
   // Add objects for each value of:
   for(int j=0; j < ny; j++){
     float lo = lo1;
   // Add objects for each value of lo:
   for (int i = 0; i < nx; i++) {
     JsonObject obj = datameteo.createNestedObject();
     Serial.println(lo);
     String str = String(la) + ";" + String(lo);
     JsonArray altitudes = obj.createNestedArray(str);
     JsonObject altitudeObj = altitudes.createNestedObject();
     altitudeObj["altitude"] = random(100, 200);
     lo+=0.01;
   }
   la-=0.01;
   }

  
  

   // Open the newjson.txt file in write mode
   File file = SD.open("/newjson.txt", FILE_WRITE);
   if (!file) {
     Serial.println("Failed to open file.");
     return;
   }

   // Write the JSON array to the file
   serializeJson(doc, file);


   // Close the file
   file.close();
   Serial.println("File created successfully!");
   delay(2000);
   }
}

The original json file is attached.
altitude_data_json.txt (46.8 KB)

If we take into account only the altitude part, which is a good start, the json comes down to this:

    {
        "header":{
            "discipline":2,
            "gribEdition":2,
            "gribLength":275,
            "center":84,
            "subcenter":0,
            "refTime":"2019-01-01T00:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":2,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":7,
            "parameterUnit":"m",
            "genProcessType":1,
            "forecastTime":0,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":0,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            2609.655,
            2517.03,
            2312.53,
            2392.03,
            2493.78,
            2470.655,
            2401.655,
            2370.28,
            2399.53,
            2416.405,
            2561.78,
            2440.28,
            2236.53,
            2243.53,
            2194.78,
            2377.03,
            1942.28,
            2173.155,
            2340.155,
            2306.28,
            1976.155,
            1692.78,
            1917.53,
            2052.155,
            1439.155,
            1688.28,
            1727.28,
            1792.03,
            1569.405,
            1390.905,
            1434.155,
            1588.53,
            1045.03,
            1072.53,
            1091.28,
            1204.655,
            1133.655,
            1478.53,
            1736.655,
            1809.78,
            1247.28,
            1392.655,
            1287.405,
            1076.78,
            981.27997,
            1099.905,
            1274.905,
            1407.155
        ]
    }

How to modify the json created( JsonArray datameteo) to add altitude objects, other arrays in geo-point arrays, modify the values?
If outputting to JSON is too complicated, arrays[] are fine as well.

That model output file is not a valid JSON construction.

Here are the rules: What is JSON

I modified the json as I want it to be, with a valid construct this time.
Of course, if storing in an array is simpler, a similar structure would be fine as well.

If you want to store the data in a file, JSON .txt is convenient and the structure is very simple.

Please explain what you mean by "storing in an array". For program code data with a variety of variable types, structures are very useful. But for readable text file storage, structures generally require custom code to convert them into ASCII.

I'm not necessarily looking to have something human readable. But something whose data can be retrieved via a quick and suitable path by a machine.
Ex: coordinates -> time -> temperature value
coordinates -> return altitude

The original file is quite poorly made which makes the data difficult to obtain optimally.

But the problem is that I can't transform the base file into a json as I want.

I say that the dataset can also be in the form of arrays[], because anyway the file will be read by a microcontroller that I would program myself

An array of structures would be required. You could write them out or read them back in as binary data to an SD card.

If you can read the base file with no problem, then declare a suitable structure for one record. The structure will not have the flexibility of a JSON object, though.

Example structure tutorial: C++ Structures (struct)

The code that created the base file you posted needs to be fixed, but there are only a couple of minor errors. I fixed the obvious ones. The following is valid and can be decoded using this: JSON Decode Online to decode JSON to readable form.


{"altitudeData":[
    {
        "header":{
            "discipline":2,
            "gribEdition":2,
            "gribLength":275,
            "center":84,
            "subcenter":0,
            "refTime":"2019-01-01T00:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":2,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":7,
            "parameterUnit":"m",
            "genProcessType":1,
            "forecastTime":0,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":0,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            2609.655,
            2517.03,
            2312.53,
            2392.03,
            2493.78,
            2470.655,
            2401.655,
            2370.28,
            2399.53,
            2416.405,
            2561.78,
            2440.28,
            2236.53,
            2243.53,
            2194.78,
            2377.03,
            1942.28,
            2173.155,
            2340.155,
            2306.28,
            1976.155,
            1692.78,
            1917.53,
            2052.155,
            1439.155,
            1688.28,
            1727.28,
            1792.03,
            1569.405,
            1390.905,
            1434.155,
            1588.53,
            1045.03,
            1072.53,
            1091.28,
            1204.655,
            1133.655,
            1478.53,
            1736.655,
            1809.78,
            1247.28,
            1392.655,
            1287.405,
            1076.78,
            981.27997,
            1099.905,
            1274.905,
            1407.155
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":1,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            282.1553,
            282.65823,
            283.89847,
            283.35355,
            282.75003,
            283.15042,
            283.6846,
            283.94437,
            283.54984,
            283.49417,
            282.53128,
            283.53128,
            285.06937,
            285.3096,
            285.63773,
            284.4102,
            285.98734,
            285.05374,
            284.54984,
            285.24026,
            287.38187,
            288.81253,
            287.45316,
            286.71,
            288.22562,
            287.54495,
            288.42972,
            288.79984,
            290.17093,
            290.71976,
            290.5342,
            289.5215,
            292.2139,
            292.34183,
            292.52933,
            291.9268,
            291.97464,
            289.13773,
            287.89163,
            287.4512,
            291.3262,
            291.00198,
            291.98343,
            293.2383,
            293.1553,
            291.6299,
            290.36234,
            289.28128
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":1,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74751.73,
            75591.73,
            77461.73,
            76730.73,
            75792.73,
            75996.73,
            76633.73,
            76932.73,
            76656.73,
            76508.73,
            75185.73,
            76295.73,
            78171.73,
            78106.73,
            78561.73,
            76871.73,
            80954.73,
            78767.73,
            77219.73,
            77541.73,
            80654.73,
            83402.73,
            81209.73,
            79920.73,
            85919.73,
            83446.73,
            83075.73,
            82450.73,
            84645.73,
            86431.73,
            85978.73,
            84420.73,
            89974.73,
            89692.73,
            89504.73,
            88333.73,
            89076.73,
            85540.73,
            82964.73,
            82235.73,
            87860.73,
            86378.73,
            87454.73,
            89642.73,
            90656.73,
            89407.73,
            87584.73,
            86225.73
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":2,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            282.63306,
            283.12524,
            284.3567,
            283.7776,
            283.14868,
            283.53345,
            284.15942,
            284.5481,
            284.23657,
            284.05005,
            283.07837,
            284.01392,
            285.51587,
            285.75806,
            286.22388,
            285.1399,
            287.39185,
            286.10474,
            285.39966,
            286.0149,
            288.21802,
            289.8108,
            288.64673,
            288.03638,
            291.2102,
            289.90356,
            290.06567,
            289.96118,
            291.27466,
            292.0188,
            291.88306,
            291.00415,
            295.05298,
            294.9729,
            294.8059,
            293.69067,
            293.89575,
            291.44165,
            289.92212,
            289.45337,
            293.50317,
            293.07837,
            293.87817,
            294.83325,
            295.21802,
            294.2522,
            292.9192,
            291.6565
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":2,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74769.98,
            75610.98,
            77471.98,
            76751.98,
            75819.98,
            76020.98,
            76654.98,
            76951.98,
            76681.98,
            76524.98,
            75212.98,
            76324.98,
            78195.98,
            78136.98,
            78588.98,
            76896.98,
            80971.98,
            78798.98,
            77251.98,
            77571.98,
            80684.98,
            83422.98,
            81236.98,
            79943.98,
            85919.98,
            83459.98,
            83093.98,
            82471.98,
            84663.98,
            86443.98,
            85984.98,
            84418.98,
            89943.98,
            89664.98,
            89482.98,
            88330.98,
            89070.98,
            85549.98,
            82977.98,
            82249.98,
            87856.98,
            86379.98,
            87450.98,
            89630.98,
            90638.98,
            89396.98,
            87585.98,
            86227.98
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":3,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            283.5935,
            284.05737,
            285.1521,
            284.6443,
            284.07202,
            284.44604,
            284.9646,
            285.23218,
            285.1316,
            284.8816,
            283.78882,
            284.7234,
            286.26538,
            286.59644,
            286.94604,
            285.75073,
            288.3943,
            286.92456,
            286.02026,
            286.6277,
            288.9109,
            290.66284,
            289.3806,
            288.76245,
            292.74878,
            291.3064,
            291.38354,
            291.32593,
            292.7644,
            293.69214,
            293.198,
            292.0808,
            296.90308,
            296.42944,
            296.12085,
            295.38647,
            295.79858,
            293.45776,
            291.56226,
            290.77222,
            294.7859,
            294.18335,
            294.96753,
            296.1775,
            296.7605,
            295.94507,
            294.57397,
            293.24487
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":3,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74803.84,
            75642.84,
            77493.84,
            76782.84,
            75857.84,
            76057.84,
            76690.84,
            76985.84,
            76718.84,
            76552.84,
            75249.84,
            76361.84,
            78227.84,
            78171.84,
            78622.84,
            76929.84,
            81011.84,
            78841.84,
            77293.84,
            77612.84,
            80719.84,
            83451.84,
            81267.84,
            79973.84,
            85943.84,
            83494.84,
            83129.84,
            82505.84,
            84687.84,
            86456.84,
            85997.84,
            84433.84,
            89945.84,
            89674.84,
            89495.84,
            88343.84,
            89075.84,
            85567.84,
            83001.84,
            82274.84,
            87868.84,
            86397.84,
            87465.84,
            89636.84,
            90639.84,
            89399.84,
            87594.84,
            86240.84
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":4,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            284.41458,
            285.00345,
            286.25833,
            285.68314,
            285.0474,
            285.37357,
            285.8091,
            286.00638,
            285.78665,
            285.57962,
            284.5972,
            285.45462,
            286.93704,
            287.2222,
            287.38626,
            286.04446,
            289.26224,
            287.63626,
            286.59232,
            287.13235,
            289.46634,
            291.38626,
            290.0181,
            289.35013,
            293.92923,
            292.4175,
            292.42435,
            292.23685,
            293.6382,
            294.60013,
            294.01028,
            292.80325,
            297.99075,
            297.33743,
            296.96732,
            296.39407,
            296.79837,
            294.39505,
            292.52493,
            291.62454,
            295.6138,
            294.90482,
            295.68118,
            297.0386,
            297.647,
            296.83548,
            295.5845,
            294.24466
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":4,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74823.875,
            75652.875,
            77493.875,
            76786.875,
            75869.875,
            76072.875,
            76705.875,
            76997.875,
            76739.875,
            76568.875,
            75263.875,
            76373.875,
            78240.875,
            78188.875,
            78641.875,
            76948.875,
            81020.875,
            78856.875,
            77311.875,
            77630.875,
            80734.875,
            83461.875,
            81281.875,
            79985.875,
            85938.875,
            83496.875,
            83134.875,
            82514.875,
            84693.875,
            86456.875,
            85997.875,
            84434.875,
            89925.875,
            89657.875,
            89482.875,
            88334.875,
            89065.875,
            85566.875,
            83002.875,
            82275.875,
            87852.875,
            86385.875,
            87452.875,
            89622.875,
            90624.875,
            89387.875,
            87585.875,
            86232.875
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":5,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            284.8379,
            285.48535,
            286.78906,
            286.08496,
            285.32422,
            285.56445,
            285.98145,
            286.18555,
            286.19727,
            285.93848,
            284.88867,
            285.71777,
            287.19727,
            287.5088,
            287.69043,
            286.33496,
            289.7998,
            288.0752,
            286.90918,
            287.4248,
            289.81445,
            291.86914,
            290.51855,
            289.84375,
            294.49316,
            292.9619,
            292.94824,
            292.7588,
            294.24023,
            295.3379,
            294.68555,
            293.42578,
            298.3877,
            297.8164,
            297.51172,
            296.98535,
            297.49805,
            295.2207,
            293.29492,
            292.3877,
            296.13574,
            295.39746,
            296.18652,
            297.59863,
            298.29395,
            297.5713,
            296.3496,
            295.1006
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":5,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74852.56,
            75676.56,
            77510.56,
            76803.56,
            75889.56,
            76099.56,
            76737.56,
            77034.56,
            76767.56,
            76597.56,
            75291.56,
            76399.56,
            78264.56,
            78213.56,
            78670.56,
            76982.56,
            81044.56,
            78884.56,
            77341.56,
            77657.56,
            80754.56,
            83474.56,
            81302.56,
            80014.56,
            85954.56,
            83518.56,
            83153.56,
            82533.56,
            84705.56,
            86463.56,
            86010.56,
            84457.56,
            89937.56,
            89668.56,
            89490.56,
            88342.56,
            89069.56,
            85580.56,
            83025.56,
            82304.56,
            87867.56,
            86402.56,
            87466.56,
            89629.56,
            90628.56,
            89393.56,
            87597.56,
            86249.56
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":6,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            285.28616,
            285.90433,
            287.34964,
            286.75296,
            286.04105,
            286.21,
            286.59573,
            286.7764,
            286.76468,
            286.40823,
            285.36917,
            286.29495,
            287.8301,
            288.13577,
            288.33206,
            287.00296,
            290.60355,
            288.72366,
            287.4561,
            288.0176,
            290.4551,
            292.5518,
            291.17972,
            290.5215,
            295.50003,
            293.73636,
            293.5225,
            293.34573,
            294.8799,
            296.04984,
            295.4053,
            294.2012,
            299.08694,
            298.5352,
            298.2305,
            297.71292,
            298.2549,
            296.0137,
            294.0508,
            293.16312,
            296.8809,
            296.12112,
            296.90433,
            298.32913,
            299.0635,
            298.3809,
            297.14944,
            295.91507
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":6,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74872.99,
            75693.99,
            77524.99,
            76810.99,
            75894.99,
            76101.99,
            76738.99,
            77038.99,
            76778.99,
            76611.99,
            75305.99,
            76407.99,
            78269.99,
            78217.99,
            78672.99,
            76988.99,
            81038.99,
            78890.99,
            77352.99,
            77667.99,
            80755.99,
            83467.99,
            81296.99,
            80009.99,
            85936.99,
            83511.99,
            83154.99,
            82538.99,
            84704.99,
            86454.99,
            85996.99,
            84441.99,
            89919.99,
            89653.99,
            89478.99,
            88334.99,
            89060.99,
            85574.99,
            83018.99,
            82293.99,
            87864.99,
            86403.99,
            87463.99,
            89619.99,
            90612.99,
            89377.99,
            87578.99,
            86231.99
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":7,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            285.72388,
            286.26685,
            287.62036,
            286.99146,
            286.25903,
            286.41724,
            286.88403,
            287.1809,
            287.25513,
            286.72583,
            285.5608,
            286.42603,
            287.98657,
            288.41138,
            288.72876,
            287.4768,
            291.32446,
            289.1311,
            287.60278,
            288.02368,
            290.52563,
            292.88892,
            291.8352,
            291.30884,
            296.53247,
            294.3557,
            293.68872,
            293.28638,
            294.76978,
            296.01587,
            295.49243,
            294.39478,
            299.53442,
            298.84985,
            298.41626,
            297.84106,
            298.30884,
            296.0022,
            294.0315,
            293.16724,
            297.32935,
            296.4524,
            297.1516,
            298.5432,
            299.1643,
            298.35767,
            297.05786,
            295.84985
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":7,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74872.984,
            75694.984,
            77526.984,
            76814.984,
            75899.984,
            76107.984,
            76740.984,
            77035.984,
            76774.984,
            76611.984,
            75304.984,
            76407.984,
            78268.984,
            78214.984,
            78668.984,
            76985.984,
            81021.984,
            78880.984,
            77347.984,
            77664.984,
            80752.984,
            83463.984,
            81294.984,
            80009.984,
            85911.984,
            83491.984,
            83140.984,
            82530.984,
            84700.984,
            86453.984,
            85998.984,
            84443.984,
            89895.984,
            89627.984,
            89456.984,
            88320.984,
            89053.984,
            85575.984,
            83022.984,
            82298.984,
            87849.984,
            86388.984,
            87447.984,
            89606.984,
            90607.984,
            89379.984,
            87586.984,
            86240.984
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":8,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            285.6371,
            286.09998,
            287.32947,
            286.64978,
            285.9154,
            286.14685,
            286.65955,
            286.97595,
            287.15955,
            286.60486,
            285.3988,
            286.09705,
            287.5951,
            288.08337,
            288.5365,
            287.4154,
            291.26794,
            289.03357,
            287.4115,
            287.63318,
            290.17322,
            292.79138,
            291.87927,
            291.349,
            296.42224,
            294.11853,
            293.24255,
            292.58044,
            294.1156,
            295.6117,
            295.21033,
            294.14783,
            299.20642,
            298.54333,
            298.1029,
            297.48572,
            297.96423,
            295.70447,
            293.67517,
            292.8031,
            297.2162,
            296.26013,
            296.91345,
            298.29333,
            298.91736,
            298.11267,
            296.7738,
            295.5863
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":8,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74851.11,
            75674.11,
            77504.11,
            76797.11,
            75883.11,
            76089.11,
            76725.11,
            77022.11,
            76748.11,
            76582.11,
            75277.11,
            76380.11,
            78244.11,
            78194.11,
            78652.11,
            76973.11,
            80992.11,
            78849.11,
            77316.11,
            77635.11,
            80729.11,
            83445.11,
            81284.11,
            80002.11,
            85891.11,
            83469.11,
            83117.11,
            82508.11,
            84683.11,
            86442.11,
            85990.11,
            84435.11,
            89877.11,
            89606.11,
            89435.11,
            88297.11,
            89033.11,
            85556.11,
            83007.11,
            82287.11,
            87828.11,
            86362.11,
            87418.11,
            89578.11,
            90580.11,
            89355.11,
            87566.11,
            86223.11
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":9,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            285.56467,
            285.97092,
            287.35275,
            286.9387,
            286.37326,
            286.53732,
            286.75412,
            286.66525,
            287.23264,
            286.59396,
            285.3713,
            286.10666,
            287.63107,
            288.092,
            288.38986,
            287.11935,
            291.40842,
            289.009,
            287.13693,
            287.259,
            289.8879,
            292.7961,
            291.6262,
            290.84982,
            296.134,
            293.72873,
            292.7463,
            292.11154,
            293.73654,
            295.37717,
            294.9211,
            293.79807,
            298.73752,
            298.05588,
            297.59592,
            296.9836,
            297.5295,
            295.36154,
            293.32248,
            292.49924,
            296.7795,
            295.75412,
            296.38596,
            297.80197,
            298.47287,
            297.71896,
            296.41232,
            295.3264
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":9,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74858.99,
            75684.99,
            77517.99,
            76804.99,
            75890.99,
            76097.99,
            76732.99,
            77027.99,
            76752.99,
            76586.99,
            75284.99,
            76388.99,
            78255.99,
            78206.99,
            78662.99,
            76977.99,
            80997.99,
            78852.99,
            77316.99,
            77637.99,
            80733.99,
            83448.99,
            81285.99,
            79997.99,
            85895.99,
            83468.99,
            83112.99,
            82500.99,
            84675.99,
            86438.99,
            85987.99,
            84433.99,
            89882.99,
            89611.99,
            89438.99,
            88294.99,
            89030.99,
            85552.99,
            83005.99,
            82285.99,
            87834.99,
            86364.99,
            87420.99,
            89581.99,
            90583.99,
            89355.99,
            87565.99,
            86223.99
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":0,
            "parameterNumber":0,
            "parameterUnit":"K",
            "genProcessType":2,
            "forecastTime":10,
            "surface1Type":103,
            "surface1Value":2.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            285.97696,
            286.42227,
            287.7133,
            287.27872,
            286.60294,
            286.50723,
            286.90176,
            287.1625,
            287.53946,
            287.0092,
            285.78946,
            286.6254,
            288.19083,
            288.5795,
            288.93008,
            287.6879,
            291.3383,
            289.08243,
            287.2924,
            287.26407,
            289.81778,
            292.70645,
            291.51114,
            290.76993,
            295.81876,
            293.52383,
            292.60977,
            291.81876,
            293.44083,
            295.1674,
            294.88126,
            293.88516,
            298.4955,
            297.76114,
            297.2836,
            296.68594,
            297.2465,
            295.10098,
            293.08047,
            292.36075,
            296.3422,
            295.38907,
            296.058,
            297.48087,
            298.11758,
            297.31485,
            295.91544,
            294.91934
        ]
    },
    {
        "header":{
            "discipline":0,
            "gribEdition":2,
            "gribLength":275,
            "center":85,
            "subcenter":0,
            "refTime":"2022-07-30T06:00:00.000Z",
            "significanceOfRT":1,
            "productStatus":0,
            "productType":1,
            "productDefinitionTemplate":0,
            "parameterCategory":3,
            "parameterNumber":0,
            "parameterUnit":"Pa",
            "genProcessType":2,
            "forecastTime":10,
            "surface1Type":1,
            "surface1Value":0.0,
            "surface2Type":255,
            "surface2Value":-9.999E-252,
            "gridDefinitionTemplate":0,
            "numberPoints":48,
            "shape":6,
            "gridUnits":"degrees",
            "resolution":48,
            "winds":"true",
            "scanMode":64,
            "nx":8,
            "ny":6,
            "basicAngle":0,
            "lo1":7.02,
            "la1":44.23,
            "lo2":7.09,
            "la2":44.18,
            "dx":0.01,
            "dy":0.01
        },
        "data":[
            74862.33,
            75683.33,
            77514.33,
            76801.33,
            75888.33,
            76096.33,
            76730.33,
            77026.33,
            76761.33,
            76595.33,
            75288.33,
            76388.33,
            78249.33,
            78195.33,
            78646.33,
            76966.33,
            81003.33,
            78860.33,
            77324.33,
            77640.33,
            80729.33,
            83440.33,
            81272.33,
            79984.33,
            85894.33,
            83468.33,
            83112.33,
            82500.33,
            84673.33,
            86433.33,
            85977.33,
            84420.33,
            89884.33,
            89612.33,
            89440.33,
            88292.33,
            89027.33,
            85541.33,
            82990.33,
            82264.33,
            87833.33,
            86360.33,
            87413.33,
            89576.33,
            90575.33,
            89340.33,
            87545.33,
            86199.33
        ]
    }

]}

I didn't quite understand what the JSON editor tool could do for me.
My problem and that I can't get a recomposed JSON like I showed.
The best I can do is:

{
  "datameteo": [
    {
      "44.23;7.02": [
        {
          "altitude": 120
        }
      ]
    },
    {
      "44.23;7.03": [
        {
          "altitude": 197
        }
      ]
    },
    {
      "44.23;7.04": [
        {
          "altitude": 123
        }
      ]
    },
    {
      "44.23;7.05": [
        {
          "altitude": 188
        }
      ]
    },
    {
      "44.23;7.06": [
        {
          "altitude": 185
        }
      ]
    },
    {
      "44.23;7.07": [
        {
          "altitude": 142
        }
      ]
    },
    {
      "44.23;7.08": [
        {
          "altitude": 185
        }
      ]
    },
    {
      "44.23;7.09": [
        {
          "altitude": 164
        }
      ]
    },
    {
      "44.22;7.02": [
        {
          "altitude": 149
        }
      ]
    },
    {
      "44.22;7.03": [
        {
          "altitude": 161
        }
      ]
    },
    {
      "44.22;7.04": [
        {
          "altitude": 196
        }
      ]
    },
    {
      "44.22;7.05": [
        {
          "altitude": 190
        }
      ]
    },
    {
      "44.22;7.06": [
        {
          "altitude": 163
        }
      ]
    },
    {
      "44.22;7.07": [
        {
          "altitude": 107
        }
      ]
    },
    {
      "44.22;7.08": [
        {
          "altitude": 108
        }
      ]
    },
    {
      "44.22;7.09": [
        {
          "altitude": 187
        }
      ]
    },
    {
      "44.21;7.02": [
        {
          "altitude": 126
        }
      ]
    },
    {
      "44.21;7.03": [
        {
          "altitude": 151
        }
      ]
    },
    {
      "44.21;7.04": [
        {
          "altitude": 155
        }
      ]
    },
    {
      "44.21;7.05": [
        {
          "altitude": 166
        }
      ]
    },
    {
      "44.21;7.06": [
        {
          "altitude": 181
        }
      ]
    },
    {
      "44.21;7.07": [
        {
          "altitude": 123
        }
      ]
    },
    {
      "44.21;7.08": [
        {
          "altitude": 196
        }
      ]
    },
    {
      "44.21;7.09": [
        {
          "altitude": 170
        }
      ]
    },
    {
      "44.20;7.02": [
        {
          "altitude": 178
        }
      ]
    },
    {
      "44.20;7.03": [
        {
          "altitude": 124
        }
      ]
    },
    {
      "44.20;7.04": [
        {
          "altitude": 146
        }
      ]
    },
    {
      "44.20;7.05": [
        {
          "altitude": 178
        }
      ]
    },
    {
      "44.20;7.06": [
        {
          "altitude": 195
        }
      ]
    },
    {
      "44.20;7.07": [
        {
          "altitude": 166
        }
      ]
    },
    {
      "44.20;7.08": [
        {
          "altitude": 131
        }
      ]
    },
    {
      "44.20;7.09": [
        {
          "altitude": 149
        }
      ]
    },
    {
      "44.19;7.02": [
        {
          "altitude": 110
        }
      ]
    },
    {
      "44.19;7.03": [
        {
          "altitude": 195
        }
      ]
    },
    {
      "44.19;7.04": [
        {
          "altitude": 155
        }
      ]
    },
    {
      "44.19;7.05": [
        {
          "altitude": 132
        }
      ]
    },
    {
      "44.19;7.06": [
        {
          "altitude": 165
        }
      ]
    },
    {
      "44.19;7.07": [
        {
          "altitude": 125
        }
      ]
    },
    {
      "44.19;7.08": [
        {
          "altitude": 140
        }
      ]
    },
    {
      "44.19;7.09": [
        {
          "altitude": 168
        }
      ]
    },
    {
      "44.18;7.02": [
        {
          "altitude": 130
        }
      ]
    },
    {
      "44.18;7.03": [
        {
          "altitude": 101
        }
      ]
    },
    {
      "44.18;7.04": [
        {
          "altitude": 127
        }
      ]
    },
    {
      "44.18;7.05": [
        {
          "altitude": 145
        }
      ]
    },
    {
      "44.18;7.06": [
        {
          "altitude": 133
        }
      ]
    },
    {
      "44.18;7.07": [
        {
          "altitude": 135
        }
      ]
    },
    {
      "44.18;7.08": [
        {
          "altitude": 166
        }
      ]
    },
    {
      "44.18;7.09": [
        {
          "altitude": 174
        }
      ]
    }
  ]
}

I managed to get a json like this (with the code from post #1) but then I can't change the altitudes, add new json objects in those of the coordinate points...
I do not know how to do. In the for loop, it pretty much works. Outside, unable to access or modify the json file.

Why do you want to recompose on an Arduino, with such limited memory and so few debugging tools?

Seems like this is a job for a PC data base editor, e.g. SQL. Read all the data in, and write back out only those parts you want, reindexed/reordered and formatted the way you like.

What program produced that JSON data file? Surely there is some flexibility there.

Hi,

In fact this work could be done by a computer. However, I don't want it to complicate. Processing by a microcontroller seemed easier to me.
I'm not exactly using an arduino but an esp32 s2 which has much better computing capabilities.
But if processing a json file on a regular server/computer is easier, then I'll have to get on with it.

If all goes well I should create a server that does this:
Asks the user for a geographical area and a time range -> Downloads meteorological data files (GRIB2) -> Selects and combines useful data from these files -> Converts GRIB2 to JSON

So we could add:
-> Convert bad JSON to optimal JSON

If you recommend this method, what tools should I use to convert my json as I want? Python, SQL, which is the simplest and most suitable in your opinion?


You decide. It is clear that you are having trouble writing a C/C++ program for ESP32 to do what you want.

If you want to hire help writing code, post on the Jobs and Paid Collaboration forum section. Seems like it might be an interesting challenge to someone.

How much do you think it costs for this kind of work?

No idea. Post and see if someone is interested.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.