Here is a sample of the .log file I need to convert. I am using Node.
{"test": "data", "test1": 123, "foo": "feel me??"}
{"test": "data", "test1": 123, "foo": "feel me??"}
{"test": "data", "test1": 123, "foo": "feel me??"}
I am importing it by using this code.
let data = fs.readFileSync(log_path, 'utf8', function(err, data){
if (err) throw err;
let tweets = data.split('\n').map(line => JSON.parse(line));
return tweets;
fs.close(data, (err) => {
console.log(err);
})
})
As you can see it's not separated by commas so is not in JSON format. I am trying to read the file, then split it by a new line, but that doesn't seem to be working.