Re:Show HN: Npm module that makes easy to convert JSON to CSV
by kauegimenes on Thursday June 08, 2017 @04:38PM
(#14517011)
This only happends if its a simple array, but if you have something like
name: 'Robert',
lastname: 'Miller',
family: null,
location: [{city: 'A'}, {city: 'B'}]
you would get 2 csv lines one with location.city A and other with B
Re:Show HN: Npm module that makes easy to convert JSON to CSV
by c0nfused on Thursday June 08, 2017 @04:23PM
(#14516921)
To answer your first question: A whole bunch of non progammer types use csv for everything. SAS and SPSS rule everything around them and they do input from csv. Source: I used to make good money doing the turn x to csv for academics all over.
As to the last, I got nothing. It's how I would have rolled.
Re:Show HN: Npm module that makes easy to convert JSON to CSV
by robmiller on Thursday June 08, 2017 @04:55PM
(#14517131)
Hey, why are you picking on me? :)
Re:Show HN: Npm module that makes easy to convert JSON to CSV
by kauegimenes on Thursday June 08, 2017 @06:10PM
(#14517561)
It's possible to implement the `location_1, location_2, location_3` as a optional feature.
But i am not sure what name to use for this option.
Re:Show HN: Npm module that makes easy to convert JSON to CSV
by traviscj on Friday June 09, 2017 @01:43AM
(#14519384)
Maybe some variant on "Extract array elements to separate columns"? or did you mean what to name the command line option? Maybe a "--list-treatment=" option, which can be "concat" or "separate"?
The complex array usecase is where an opinionated-type of conversion tool is particularly needed, but I wonder why it behaves like this:
lastname,name,family.type,family.name,nickname,location Miller,Robert,,,,1231,3214,4214Why not have `location_1, location_2, location_3`, instead of having a single location column? The latter implementation makes the data difficult to quickly use in a program (like a spreadsheet).