Skip to content

Nil values #46

@scossu

Description

@scossu

I'm writing a CSV file from a 2D table with several nil values. Currently these are encoded as "nil".

E.g.:

> csv = require "ftcsv"
> t = {                
    {f1 = "a", f2 = "b", f3 = "c"},
    {f1 = "d", f2 = "e",},
    {f3 = "f"},
    -- etc.
} 
> csv.encode(t)
"f1","f2","f3"
"a","b","c"
"d","e","nil"
"nil","nil","f"

Is there a way to encode nil as the empty string? I see a transform function for the reader but not for the writer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions