Opened 5 years ago

Last modified 5 years ago

#13253 new Feature Requests

RFC 4180 CSV separator

Reported by: tom_becker@… Owned by: jsiek
Milestone: To Be Determined Component: tokenizer
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

It would be useful to have a RFC 4180 CSV separator alternative to escaped_list_separator. The RFC 4180 CSV format is more compatible with popular spreadsheet software. It really is a different format:

  1. Putting quotes around a field allows commas only if the initial quote is at the beginning of the field.
  2. Quotes can be embedded in a quoted field if they are repeated. For example:
    field 1,"embedded "" in field 2",field 3
    
  3. Newlines can be embedded in a quoted field.
  4. There is no escape character (except for the special case of a repeated quote).

It is easy to write a tokenizer function that parses this format, except for the embedded newlines. I have some working code that could be cleaned up and submitted.

Change History (1)

comment:1 by damian.meden@…, 5 years ago

Please create a PR so it can be discussed.

Note: See TracTickets for help on using tickets.