CSV.js
CSV.js copied to clipboard
Support Definable Row Number for Header
I have need for reading CSV files from multiple sources, some of which have multi-row headers (only one of which has actual column headers). It would be nice to be able to tell the parser to ignore the first X rows of a file and/or look for headers at a set row number.
Could you supply your own header values using the below?
new CSV(data, { header: ['column 1', 'column 2', 'column 3'...])
I'd be happy to add this feature (or accept a pull request implementing it) if there's more than 1 person requesting it.
Yes I need this as well. Also how do I parse from a file as streaming read/parse
@nraghu99 CSV.js can't currently do that.
Now, a workaround would be to chop the first n lines out of the string before it hits CSV. str = str.substring(str.indexOf( line_delimiter ) + 1); Repeat for how many lines you want to ignore.