Skip to content

The Nested CSV doesn't convert to JSON properly #443

Open
@pranaymistry

Description

@pranaymistry

When I use the sample nested CSV provided and I try to run it in VS Code I don't get the desired JSON output. Please help resolve this issue ASAP.

My Test CSV

image

JS Code

const csvFilePath='test.csv' const csvtojsonV2=require("csvtojson/v2"); csvtojsonV2() .fromFile(csvFilePath) .then((jsonObj)=>{ console.log(jsonObj); /** * [ * {a:"1", b:"2", c:"3"}, * {a:"4", b:"5". c:"6"} * ] */ })

VS Code Output

image

Full VS Code JS Code with output

image

Even on the MAC Terminal I get the same [Array] for the nested JSON object and not the actual JSON

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions