Skip to content
New issue

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

Support Definable Row Number for Header #15

Open
jcq opened this issue Jul 7, 2014 · 4 comments
Open

Support Definable Row Number for Header #15

jcq opened this issue Jul 7, 2014 · 4 comments
Labels

Comments

@jcq
Copy link

jcq commented Jul 7, 2014

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.

@CyrusOfEden
Copy link
Owner

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.

@nraghu99
Copy link

Yes I need this as well. Also how do I parse from a file as streaming read/parse

@CyrusOfEden
Copy link
Owner

@nraghu99 CSV.js can't currently do that.

@NathanSmutz
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants