ben-strasser / fast-cpp-csv-parser

fast-cpp-csv-parser
BSD 3-Clause "New" or "Revised" License
2.11k stars 440 forks source link

Support for escaped separators and newlines #71

Closed eyalroz closed 6 years ago

eyalroz commented 6 years ago

I'f I'm not mistaken, the library doesn't currently support CSV files in which quoted strings contain column separators or newlines. Such support should be added; and while it is missing, the README should indicate that only a subset of the CSV specification is supported.

ben-strasser commented 6 years ago

Newlines are not allowed in quoted strings. Column separators are allowed, if you use the right policies.

On 08/21/2018 10:20 AM, Eyal Rozenberg wrote:

I'f I'm not mistaken, the library doesn't currently support CSV files in which quoted strings contain column separators or newlines.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ben-strasser/fast-cpp-csv-parser/issues/71, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaAj_m1jM0gBolTYZY-3EUmJ4cc_sXSks5uS8LbgaJpZM4WFUDU.

eyalroz commented 6 years ago

Newlines are most certainly allowed in quoted fields. The CSV spec (RFC 4180) specifically mentions this in Section 2.6:

2.  Definition of the CSV Format

...

  6.  Fields containing line breaks (CRLF), double quotes, and commas
      should be enclosed in double-quotes.  For example:

         "aaa","b CRLF
         bb","ccc" CRLF
         zzz,yyy,xxx