Wrong placement in multi-array set
See original GitHub issueHere’s my code
var test = [
{
"name" : "John",
"clases" : [
{
"year" : 2016,
"grade" : "1st",
"payment":[
{
"type":"monthly",
"status":"done"
},
{
"type":"yearly",
"status":"done"
}
]
},
{
"year" : 2017,
"grade" : "2nd",
"payment":[
{
"type":"monthly",
"status":"in progress"
},
{
"type":"yearly",
"status":"done"
}
]
}
],
},
{
"name" : "Andrew",
"clases" : [
{
"year" : 2017,
"grade" : "1nd",
"payment":[
{
"type":"monthly",
"status":"in progress"
},
{
"type":"yearly",
"status":"in progress"
}
]
}
]
},
]
jsonexport(test,function(err, csv){
if(err) return console.log(err);
console.log(csv);
});
and here is the output
name,clases.year,clases.grade,clases.payment.type,clases.payment.status
John,2016,1st,monthly,done
,2017,2nd,yearly,done
,,,monthly,in progress
,,,yearly,done
Andrew,2017,1nd,monthly,in progress
,,,yearly,in progress
as you can see, the values are not supposed to be there. It should drop on the next line. And is there any option to force rewrite values so it would be look like this?
Thank you…
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
java - 2D Array - wrong "Wall " placement? - Stack Overflow
In the inner for-loop of your setRoomFloor method, you're inverting the position on the x-axis and the position on the y-axis.
Read more >Boost.MultiArray Reference Manual - 1.68.0
It specifies operations for accessing elements, traversing containers, and creating views of array data. MultiArray defines a flexible memory model that ...
Read more >FB_CMA_SourcePaired - Beckhoff Information System - English
Writes data from external two-dimensional data buffers to a pair of MultiArrays. This method must be called whenever new input samples are available,...
Read more >PowerShell Multidimensional Array | Initialization of ... - eduCBA
If we defined array as strictly type and we are trying to assign different data types of then it will throw an error....
Read more >How to initialize (or Declare) a multidimensional array
Not declaring how many items in each row will give you this cryptic error: "multidimensional array must have bounds for all dimensions except ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My thought is that it will get awfully ugly and convoluted for arrays inside arrays, or array of objects with arrays.
I wouldn’t approach this one as a catering company. Don’t do, a change like this needs an accompanying document type. CSV doesn’t have metadata by nature. You best stick to as little format variations as possible.
We can do anything, don’t think we should for consistency sake
I abolsutely think this issue should be closed.
@saipallavi, I have starred your example over for quite sometime. I disagree with you, I see expected result. A child-arrary’s first row belongs with-in the parent row. If jsonexport did what you are asking for, it’d be a hard breaking change. Your “I need the output like this” example, would actually mean you have a 2nd parent who’s CODE, GROUP_NAME, and GROUP_DESC are all null but has a 3 child length array (not to mention row 1 has no children).
Lets close this. Wouldn’t even offer an option to pivot the behavior to keep tight format standards