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

CSV File - Delimiter Between Quotes #666

Open
LC6529 opened this issue Feb 28, 2024 · 3 comments
Open

CSV File - Delimiter Between Quotes #666

LC6529 opened this issue Feb 28, 2024 · 3 comments

Comments

@LC6529
Copy link

LC6529 commented Feb 28, 2024

Sample Header Line

"Last Name", "First Name", "Last Name, First Name", "Address Line One"

There needs to be a way to tell CSVReader to ignore delimiters between quotes.

Currently when trying to read this file it sees four delimiters in the line above when it should only see three.

The only way to get the file to be read is to open it in excel and save it as an XLS file which is not an option.

@appel1
Copy link
Collaborator

appel1 commented Apr 15, 2024

I cannot reproduce this. Could you provide a sample .csv file and code that reproduces this issue?

@LC6529
Copy link
Author

LC6529 commented Apr 16, 2024 via email

@appel1
Copy link
Collaborator

appel1 commented Apr 16, 2024

What version are you using?

Using the latest prerelease this test passes.

[Test]
public void GitIssue666()
{
    MemoryStream ms = new(Encoding.UTF8.GetBytes("\"Brown\",\"John\",\"123 Mockingbird Lane, Apt 3G\", \"Oakland\", \"California\""));
    using var reader = ExcelReaderFactory.CreateCsvReader(ms);
    reader.Read();
    var values = new object[reader.FieldCount];
    reader.GetValues(values);

    Assert.That(values, Is.EqualTo(new object[] { "Brown", "John", "123 Mockingbird Lane, Apt 3G", "Oakland", "California" }));
}

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

No branches or pull requests

2 participants