Hey RayRay,
Thanks for this, it was super helpful with my project.
I had one small issue with \r being inserted into my column 2 keys and values which sounds like it was the same as Mohd.
Here was my solution:
const csvArray = csvToArr(e.target.result, ",");
csvArray.value = JSON.stringify(csvArray, null, 2).replaceAll("\\r","");
Simply just use replaceAll to remove the '\r's.
There is probably a nicer way to do that, but this is good enough for me.
Thanks again.
Bryon