mholt / PapaParse

Fast and powerful CSV (delimited text) parser that gracefully handles large files and malformed input
http://PapaParse.com
MIT License
12.57k stars 1.15k forks source link

FR: Option to choose _how many_ rows are used to autodetect columns #1051

Open SkepticMystic opened 7 months ago

SkepticMystic commented 7 months ago

When unparsing an object array, only the first object is used to autodetect the columns for the final csv. However, if the second object has fields the first doesn't, they'll be missing in the output.

One can certainly do this manually by tracking and building a set of unique fields, then passing it under config.columns. But it would obviously be nice if Papaparse can do this for us.

khaleel56 commented 6 months ago

It would be immensely helpful if PapaParse could retain all columns in the output CSV, even when the number of columns varies across rows