We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As a workaround I'm having to parse, unparse and parse again in order to read a file with no headers and get an array of objects:
Papa.parse(file, { complete: result => { let contentWithHeader = Papa.unparse({ fields: ['column1', 'column2', 'column3'], data: result.data }); let newResult = Papa.parse(contentWithHeader, { header: true }); console.log(newResult); } });
File:
valueA;valueB;valueC valueD;valueE;valueF ...
Result:
data: [{ column1: "valueA" column2: "valueB" column3: "valueC" }, { column1: "valueD" column2: "valueE" column3: "valueF" }, ... ]
I could also append the headers to the file, but I'd have to read it first and I don't think that would be good for performance neither.
The text was updated successfully, but these errors were encountered:
Makes sense for me. It iwll be great if you can fill a PR implementing it
Sorry, something went wrong.
a 'fields' configuration option may receive an array of column names that would override the first line originating headers, if they exist.
No branches or pull requests
As a workaround I'm having to parse, unparse and parse again in order to read a file with no headers and get an array of objects:
File:
Result:
I could also append the headers to the file, but I'd have to read it first and I don't think that would be good for performance neither.
The text was updated successfully, but these errors were encountered: