Closed johnyesberg closed 6 years ago
Hi @johnyesberg,
That's pretty much how it works. The stream API (which is the one intended for large datasets) does exactly that. The sync API (which is intended for small dataset) goes through all the records in the dataset and collect all the possible fields before actually doing the conversion to CSV.
The above works as long as you haven't specified your own fields.
Hi and thanks again.
My JSON records are very large and all have identical structure. Writing out the field list is tedious. I think that a principle-of-least-surprise option might be that if there is no list of fields specified, then json2csv uses all of the fields from the first record. I'd be interested in your thoughts.
Best wishes John