How can i parse a log file to JSON. - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: How can i parse a log file to JSON. (/thread-27092.html) |
How can i parse a log file to JSON. - menarcarlos - May-25-2020 Hi, I'm noob in python. How can i parse a log file to JSON. From this: Quote: ----------------------------------- To this: Quote: ['process', 'date debut', 'date end', 'hour start', 'hour end'] and so on. Many thanks. RE: How can i parse a log file to JSON. - pyzyx3qwerty - May-26-2020 https://stackoverflow.com/questions/35220002/log-file-to-json-file-conversion/35221057 RE: How can i parse a log file to JSON. - buran - May-26-2020 the expected output you show is not JSON, show what you expect as output. It may be ndjson, but it uses single quotes otherwise parse the log file and identify separate records - it looks easy task - either by reading and analyzing each line or using regex |