Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten doesnt work when smaller arrays are first. #2

Open
ehiggs opened this issue Jul 15, 2021 · 1 comment
Open

Flatten doesnt work when smaller arrays are first. #2

ehiggs opened this issue Jul 15, 2021 · 1 comment

Comments

@ehiggs
Copy link

ehiggs commented Jul 15, 2021

Given the following input:

cat test.json 
{
    "name": "michael",
    "family": [
        {
            "name": "theodore",
            "relation": "father"
        }
    ]
}
{ 
    "name": "john",
    "family": [
        {
            "name": "jane",
            "relation": "sister"
        },
        {
            "name": "janet",
            "relation": "mother"
        }
    ]
}

Yields the following:

json2csv -F test.json
family.0.name,family.0.relation,name
theodore,father,michael
jane,sister,john
@alexwennerberg
Copy link
Owner

A necessary consequence of streaming parsing. You can use the new samples parameter or specify the fields manually with `--fields``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants