---
title: "Comment by TooMuchTofu on \"Convert A CSV To A JavaScript Array of Objects — The Practical Guide\" | Hashnode"
description: "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 li"
url: "https://hashnode.com/posts/convert-a-csv-to-a-javascript-array-of-objects-the-practical-guide/6322e5018350c8888bf3043b/comment/636d9fc54597d909de581c42"
---

[Discussion](https://hashnode.com/posts/convert-a-csv-to-a-javascript-array-of-objects-the-practical-guide/6322e5018350c8888bf3043b)

Comment [Convert A CSV To A JavaScript Array of Objects — The Practical Guide](https://hashnode.com/posts/convert-a-csv-to-a-javascript-array-of-objects-the-practical-guide/6322e5018350c8888bf3043b)

[TooMuchTofu](https://hashnode.com/@TooMuchTofu)

[Nov 11, 2022](https://hashnode.com/posts/convert-a-csv-to-a-javascript-array-of-objects-the-practical-guide/6322e5018350c8888bf3043b/comment/636d9fc54597d909de581c42)

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

[Dev By RayRay](https://hashnode.com/@devbyrayray)

[Nov 11, 2022](https://hashnode.com/posts/convert-a-csv-to-a-javascript-array-of-objects-the-practical-guide/6322e5018350c8888bf3043b/comment/636d9fc54597d909de581c42#reply-636dfe4480c99a14d29c68a6)

I'm happy that it was helpful to you!

Thanks for the suggestion, I'm gonna look into it. Did you use the data in the post? Or did you use your data? Maybe there is a difference in it.
