Skip to content

If separator is undefined csv behaves in unexpected way #71

@llazzaro

Description

@llazzaro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions