You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/07/30 17:29:34 UTC

[jira] [Commented] (CSV-93) Allow the handling of NULL values

    [ https://issues.apache.org/jira/browse/CSV-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424912#comment-13424912 ] 

Sebb commented on CSV-93:
-------------------------

The problem is, this may clash with situations where textual data does not have to be quoted.

I agree it would be useful to be able to represent null; however it needs to be done in a way that is unambiguous. This may require adding an option, e.g. to force text to be quoted.
                
> Allow the handling of NULL values
> ---------------------------------
>
>                 Key: CSV-93
>                 URL: https://issues.apache.org/jira/browse/CSV-93
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Documentation, Parser, Printer
>    Affects Versions: 1.0
>            Reporter: Georg Tsakumagos
>         Attachments: patch.txt
>
>
> h5. Requirement
> To use the CSV parser and printer for SQL Dumps it would be nice if they could handle *null* values. 
> h5. Specification
> To distinguish between an *empty* or *null* value empty values always gets quoted to denote an empty string. The absence of an quote denotes a *null* value
> h5. Configuration
> To activate the behavior call the method _withNullObjectPatternEnabled_ of the _CSVFormat_ with parameter _true_.
> h5. Modifications
> See attached patch.
> h5. Example
> This example using as base the _DEFAULT_ _CSVFormat_ modified by the NullObjectPattern behavior.
> || Array-Data || CSV-Data ||
> | \{null,"","A"," "\}; |,"A",""," " |
> | \{"",null,"A"," "\} |"",,"A"," " |
> | \{"","A",null\} |"","A", |

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira