I want to parse a file that contains multiple JSON objects that are not enclosed in an array and are separated only by a line break. The file has the following schema:
{"id":1,"firstName":"John","lastName":"Doe"}
{"id":2,"firstName":"Bob","lastName":"Smith"}
As far as I know, the standard approach using json.load()
doesn't work here, because the objects are not enclosed in an array. So is there an elegant way to parse such a file in Python without modifying it?