aswinkarthik / csvdiff

A fast diff tool for comparing csv files
https://aswinkarthik.github.io/csvdiff/
MIT License
532 stars 57 forks source link

Management of NULL value #40

Open tmtben opened 4 years ago

tmtben commented 4 years ago

Hello,

Thanks again for this great tool. I've got one suggestion to make it even better.

By my side, when I create a csv file, I try to tell apart NULL value and empty string. Here is an example with comma separator: • ,, means NULL • ,"", means empty string

In fact, all my strings are encapsulated by double quotes: ,"My string",

For me, numerical values, booleans and timestamps are not string: ,1234567890,

For my use case, the solution could be: If input field of csvdiff is encapsulated by double quotes, output field of csvdiff must be encapsulated too (even if output value is empty).

Best regards, Ben

aswinkarthik commented 4 years ago

In Golang, nulls cannot be stored as a string. It is read as an empty string by the csvreader. Only a pointer can store nils. I will think about a solution for this.