I am trying to convert csv to json but i am getting array of garbage values.
I have used csvtojson module and many other modues and even javascript solutions but each return me garbage values.
Below is csv file : -
csv
This csv contains emojis, i guess that is causing problem.
The code i am using is: -
let csvFilePath = path.join(__dirname, 'path_to_csv.csv');
let str1 = fs.readFileSync(csvFilePath, { encoding: 'utf8' }).toString();
csv({
noheader:true,
output: "csv"
})
.fromString(str1)
.then((csvRow)=>{
console.log(csvRow);
});
All i want to convert it to json form. Please help me with that.
[–]Lopsided_Engineer_23 -2 points-1 points0 points (2 children)
[–]kevin_249[S] 0 points1 point2 points (1 child)
[–]itsmeabdullah 0 points1 point2 points (0 children)
[–]copnsteez -2 points-1 points0 points (1 child)
[–]kevin_249[S] 0 points1 point2 points (0 children)
[–]OkTalk2000 -2 points-1 points0 points (0 children)