vincentlaucsb / csv-parser

A high-performance, fully-featured CSV parser and serializer for modern C++.
MIT License
901 stars 150 forks source link

Leading spaces for quoted values aren't ignored #190

Closed pratzl closed 2 years ago

pratzl commented 2 years ago

If a line has something like the following "Value1", "Value2", "Value3"

where there are spaces before the quote on Value2 and Value3, the field value includes the leading spaces and the quotes. If I remove all leading spaces the leading and trailing quote are correctly found.

In my experience with CSV files, it seems like the leading spaces should be ignored before any value.

I haven't check for trailing spaces after the 2nd quote. Those should also be ignored, before the delimiter.

vincentlaucsb commented 2 years ago

image

This parser is intended to parse files consisting of fields separated by a single character and maybe encased in quotes. I have no intentions of supporting parsing of non-RFC 4180 compliant files.