I work with JSON an i came across a problem. I have JSON file like this
{"Text":"Here is some text","Make":"Admin","Name":"Hello"}
{"Text":"Here is some text","Make":"John","Name":"Hello"}
{"Text":"Here is some text","Make":"Admin","Name":"Hello"}
and I need to read from this file all text. I try but throws exception here is my code to read
JSONParser parser = new JSONParser();
Object obj = null;
try {
obj = parser.parse(new FileReader("Project.json"));
JSONObject jsonObject = (JSONObject) obj;
String name = (String) jsonObject.get("Text");
System.out.println(name);
}
catch (IOException e) {
e.printStackTrace();
} catch (org.json.simple.parser.ParseException e) {
e.printStackTrace();
}
Thx for help