Tech Lead / Lead Developer in the π³π± https://byrayray.dev/
π Tech Lead / Lead Developer π₯ Writing about CSS, JavaScript, Typescript, Angular, Vue.js, Nuxt.js, Serverless functions, and a lot more web-related topics. https://byrayray.dev/
Markdown supported Β· ββ΅ to post
Hello,
I'm new to Javascript, after trying the above, I realize there is '\r' at the end of the last column (including the rows). How do I fix this?
Thank you.
TooMuchTofu
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