Is there a way to configure how SuperCSV expects to handle NULL values? This is sometimes handled as:
,,
or as:
,NULL,
or as:
,null,
But I can't seem to find a way to configure how SuperCSV expects to handle these, especially for numeric columns.
,,
is handled automatically by Super CSV. For example the following:Will print
You can make it handle
"NULL"
and"null"
as well by using cell processors (a combination ofOptional
andToken
). To make it more reusable, you can define your own processor which simply sets this up. This processor will check fornull
, then"null"
, then"NULL"
and returnnull
if it finds a match, otherwise it will return the value unchanged.You can then use this processor
Which will print
To handle numeric columns, you can simply chain it together as you would with
Optional
: