-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
@AnthonyMastrean
Description
It seems like the parser is treating empty columns as the empty string, not null. Using the following model and example CSV, this library will produce an empty string for the 2nd Message property. I'd prefer for these to be treated as null values.
public class Example { public string Key { get; set; } public string Message { get; set; } public int Code { get; set; } }
Key;Message;Code
ABC;this is a message;200
XYZ;;400
You might introduce a Boolean or Enum setting into CsvFormatterOptions? I suspect a change would be required somewhere around here:
Of course, some CSV handling systems develop entire complicated schemes (see the PostgreSQL COPY statement, for example).