i have json that looks like this:
{
"message": ".replace(commentRegExp, '')",
"report_id": 1961272
}{
"message": ".replace(currDirRegExp, '')",
"report_id": 1961269
}{
"message": ".replace(jsSuffixRegExp, '');",
"report_id": 1961270
}
how to make it into correct format using python i want the json data to look like this:
[
{
"message": ".replace(commentRegExp, '')",
"report_id": 1961272
},
{
"message": ".replace(currDirRegExp, '')",
"report_id": 1961269
},
{
"message": ".replace(jsSuffixRegExp, '');",
"report_id": 1961270
}
]
Something like this will split up the root elements
Edit to Read from file;
The Bulk of what this solution is doing is based around the
[{].*?[}]regex which will find all the json root elements then comma separate them and append square brackets on the start and end