0

I've got a json file log.json wich contain the following json :

{ "time": "2018-04-26 10:28:40.1546", "function": "test", "line": "632", "userWindows": "Kenny ", "level": "INFO", "message": "Hello" } 

{ "time": "2018-04-26 10:28:40.1546", "function": "test", "line": "633", "userWindows": "Kenny ", "level": "INFO", "message": "Logon by user: Kenny from ip_address:127.0.0.1" } 

It's know it's not a correct json format and it should be [{],{}] and not {}{}. But how can i manage to do something with that ? I'm a bit lost , can someone give me a lead ?

My first idea was to deserialize the file and to use it to populate a gridivew.

warkanix
  • 13
  • 2
  • Cant you read file line by line and use custom deserializer which detects target class from json attributes? – Emre Savcı Apr 26 '18 at 09:58
  • Try [Line delimited json serializing and de-serializing](https://stackoverflow.com/q/29729063/3744182). The extra blank lines between JSON objects *might* cause problems though, let us know if they do. – dbc Apr 26 '18 at 16:26
  • The answer from [Line delimited json serializing and de-serializing](https://stackoverflow.com/q/29729063/3744182) works just fine even with the blank lines, see https://dotnetfiddle.net/PFOzrx. Closing as a duplicate. – dbc Apr 26 '18 at 16:32
  • 1
    Thank you for the link , it exacly what i was looking for. I tested it and it works – warkanix Apr 27 '18 at 08:36

0 Answers0