parsing csv with two double quotes #656

Closed
opened 2017-05-17 05:15:52 +00:00 by jckkong · 2 comments
jckkong commented 2017-05-17 05:15:52 +00:00 (Migrated from github.com)

Hey there, I am having trouble parsing the below csv file

id,name,status,metaTags,tagsValue,html,type
8.0061202380238,sup,active,"[""number1"",""number2""]","{""name"":""calvin""}","<html>
    <head>
        
    </head>
    <body>
        hi {{name}}
    </body>
</html>",image

Noticed the metaTags are parsed incorrectly.

the return json

{
  "Sheet1": [
    {
      "id": "8.0061202380238",
      "name": "sup",
      "status": "active",
      "metaTags": "[\"number1\"",
      "tagsValue": "\"number2\"]",
      "html": "{\"name\":\"calvin\"}",
      "type": "<html>\r    <head>\r        \r    </head>\r    <body>\r        hi {{name}}\r    </body>\r</html>"
    }
  ]
}

the expected json is

{
  "Sheet1": [
  {
    "id": "80061200000000000",
    "name": "sup",
    "status": "active",
    "metaTags": ["number1","number2"],
    "tagsValue": {"name": "calvin"},
    "html": "<html>\r    <head>\r        \r    </head>\r    <body>\r        hi {{name}}\r    </body>\r</html>",
    "type": "image"
  }
]
}
Hey there, I am having trouble parsing the below csv file ``` id,name,status,metaTags,tagsValue,html,type 8.0061202380238,sup,active,"[""number1"",""number2""]","{""name"":""calvin""}","<html> <head> </head> <body> hi {{name}} </body> </html>",image ``` Noticed the `metaTags` are parsed incorrectly. the return json ``` { "Sheet1": [ { "id": "8.0061202380238", "name": "sup", "status": "active", "metaTags": "[\"number1\"", "tagsValue": "\"number2\"]", "html": "{\"name\":\"calvin\"}", "type": "<html>\r <head>\r \r </head>\r <body>\r hi {{name}}\r </body>\r</html>" } ] } ``` the expected json is ``` { "Sheet1": [ { "id": "80061200000000000", "name": "sup", "status": "active", "metaTags": ["number1","number2"], "tagsValue": {"name": "calvin"}, "html": "<html>\r <head>\r \r </head>\r <body>\r hi {{name}}\r </body>\r</html>", "type": "image" } ] } ```
SheetJSDev commented 2017-05-17 05:24:34 +00:00 (Migrated from github.com)

Hello and thanks for reporting! We can reproduce the issue, we'll try to cut 0.10.3 soon with the fix.

Hello and thanks for reporting! We can reproduce the issue, we'll try to cut 0.10.3 soon with the fix.
SheetJSDev commented 2017-05-17 18:11:35 +00:00 (Migrated from github.com)

The browser version has been updated:

screen shot 2017-05-17 at 14 10 51

It'll be rolled out to npm once the node tests pass

The browser version has been updated: <img width="888" alt="screen shot 2017-05-17 at 14 10 51" src="https://cloud.githubusercontent.com/assets/6070939/26169167/b2993f00-3b0a-11e7-98fa-353d5564504c.png"> It'll be rolled out to npm once the node tests pass
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#656
No description provided.