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

If separator is undefined csv behaves in unexpected way #71

Open
llazzaro opened this issue Jul 17, 2017 · 0 comments
Open

If separator is undefined csv behaves in unexpected way #71

llazzaro opened this issue Jul 17, 2017 · 0 comments

Comments

@llazzaro
Copy link

I was using the lib and forgot to pass the separator parameter to the directive.
When no value is passed the line:

var currentline=lines[i].split(new RegExp(content.separator+'(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)'));

Will use as regex the value 'undefined(?![^"]"(?:(?:[^"]"){2})[^"]$)' and the csv will not be correclty parsed.

I think we should raise and error or use comma as default value.

Let me know you desicion and I will be happy to open a pull request.

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

No branches or pull requests

1 participant