Closed magoarcano closed 3 years ago
Thanks for your suggestion but I do not think we should implement that.
The objetive of PapaParse is just to parse the data and return all the parsed file. If you just need a subset of the information for each row is just a mather of filtering this data after the file is parsed.
If you can are about performance you can use streaming to filter the data.
When
headers=true
sometimes we don't want al the fields in the returned parsed items.Now if headers line is:
id, name, date, description
I get the parsed items:[{id: "23", name: "John", date: "2021-01-01", description: "very long text I don't care"}, ...]
It would be nice to return just the fields we need, specially when there are many unwanted fields, the file is very big, or field values are very long.
Better to get:
[{id: "23", name: "John", date: "2021-01-01"}, ...]
We could define the un/wanted fields in the
transformHeader
function, being ignored if it returnsnull
. Or adding other parameters to theconfig
:ignore
(providing a list of the fields to ignore), andonly
(providing a list of fields to include only them)