osiegmar / FastCSV

CSV library for Java that is fast, RFC-compliant and dependency-free.
https://fastcsv.org/
MIT License
542 stars 93 forks source link

Option to set null string? #33

Closed revyTH closed 4 years ago

revyTH commented 5 years ago

Null string default is written as "null". Should be present a setter to override the default null string

osiegmar commented 4 years ago

FastCSV writes a null string as an empty field, not as "null".

try (CsvAppender csv = new CsvWriter().append(new PrintWriter(System.out))) {
    csv.appendLine("foo", null, "bar");
}

prints: foo,,bar

If you want to transform null to some other value, why pass null to FastCSV?