-1

How to parse the elements in Json file if Json is in below format:

    "A"{
    {
    "S":5{
    "R":4[
     [
    [
    1,2
    ],
    [
     3,4
    ],
    [
    5,6
    ]
    ]
    ]
    },
.   "B":{
.   "E":2
    "F":4
    }
    }
RealSkeptic
  • 33,993
  • 7
  • 53
  • 79
  • Start with having a valid JSON to parse, then use a parser. – Mena Dec 15 '16 at 12:34
  • https://jsonformatter.curiousconcept.com/ make this format work first – Milaci Dec 15 '16 at 13:38
  • 1
    This is not a valid JSON file. Where do you get it in that format? It's not a matter of nested elements, it's a matter of not being JSON at all. – RealSkeptic Dec 15 '16 at 13:52
  • Use http://jsonlint.com/ to check if your JSON is valid. Like RealSkeptic said, yours currently isn't. – Tom Dec 15 '16 at 13:54

1 Answers1

1
 Correct format {  
       "A":{  
          "S":{  
             "R":[  
                [  
                   [  
                      1,
                      2
                   ],
                   [  
                      3,
                      4
                   ],
                   [  
                      5,
                      6
                   ]
                ]
             ]
          }
       },
       "B":{  
          "E":2,
          "F":4
       }
    }

And than you can parse after reading : How to parse JSON in Java

Community
  • 1
  • 1
Milaci
  • 515
  • 2
  • 7
  • 24