I have a .dat file that contains information that is not clear to read it.
So, I was trying to read that file and convert it to human-readable text/json.
I implemented this code but don't know how to convert readable text/json file.
fs.readFile('./2.dat', 'utf8', (err, data) => {
if (err) throw err
console.log(data)
})
This is the file 2.dat
Your file looks like some kinf of CSV with | as a delimiter. YOu need to use some package to parse CSV like csv-parse to get lines as JS-objects.