Is there any way to include # in the CSV input without breaking the format

45 views Asked by At

In my project I am trying to create CSV report by converting a JSON to comma seperated values enclosed with double quotes. But while in the JSON I have # as a value in some places. So while downloading CSV report i am getting the only contents which are present before #. But I need to show # in my CSV report. Help me to solve this in Js.enter code here

Tried the escape sequence for # '#' still it is not working

The real JSON is like this

    "details": [{
    "name": "def",
    "number": "123#456",
    "class": "one"
},
{
    "name": "ab",
    "number": "123#456",
    "class": "two"
}]

and I am appending these values with "" like

row+=`"${details.name}"`..

So expected output should be name number class def 123#456 one ab 23#456 two

But the output is name number class def 123

Nothing is printing after starting from '#' –

0

There are 0 answers