I'm using papaParse to parse an CSV file into JSON for further use. Upon parsin it returns
"errors": [ { "type": "FieldMismatch", "code": "TooFewFields", "message": "Too few fields: expected 21 fields but parsed 1", "row": 14 } ], "meta": { "delimiter": ";", "linebreak": "\r\n", "aborted": false, "truncated": false, "fields": [ "Output in top 10 percentiles (%)", "Overall", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014" ] } }
can somebody please explain to me what this means? I read trough the documentation on their webpage but still don't understand what is wrong
the CSV file I'm working with is this (http://www.topdeckandwreck.com/excel%20graphs/Sheet10.csv)
In your config, add
skipEmptyLines: true
Reference: http://papaparse.com/docs#config-details
Solution was posted by Lasse V Karlsen in the comments, removing the last empty line in notepad so the CSV file contains only data removes the error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With