0

I need some help to read in Java a large text file that contains 25000 JSON objects that are delimited by newline. Example:

{"productName":"Latitude E2000","Make":"Dell"} 
{"productName":"Latitude E2500","Make":"Dell"} 
{"productName":"Vaio2000","Make":"Sony"} 
{"productName":"Vaio2500","Make":"Sony"} 
{"productName":"A2000","Make":"Asus"} 
{"productName":"A3000","Make":"Asus"}

If the file contains only one JSON object then it's pretty straightforward as there's many examples out there. But I haven't been able to find an example that reads a file with multiple JSON objects separated by newline.

Thanks!

k.t.
  • 1
  • 1
  • What have you tried so far? Try to think of the separate parts of the problem. Reading each line and for each line parse it as JSON. – Roger Lindsjö May 01 '17 at 18:40
  • Thanks I will try that, just not sure if it will slow down my application a bit as I have to read two large files and do some comparing to find how many matches there are between the two files. I am reading about Jackson as well, seems there's some examples of that. – k.t. May 01 '17 at 18:59

0 Answers0