[ 
https://issues.apache.org/jira/browse/CSV-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory resolved CSV-93.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

{noformat}
commit -m "[CSV-93] Allow the handling of NULL values. Use a single property 
'nullString' for both input and output processing. No substitutions occur if 
null. For reading, nullString is used to convert field values to null. For 
writing, nullString is used to output the given string instead of the empty 
string." 
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVParser.java
 
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVPrinter.java
 
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVFormat.java
 
C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
    Sending        
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVFormat.java
    Sending        
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVParser.java
    Sending        
C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVPrinter.java
    Sending        
C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
    Transmitting file data ...
    Committed revision 1495911.
{noformat}

                
> 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
>             Fix For: 1.0
>
>         Attachments: CSV-93.diff, 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", |
> h5. NULL in DBMS proprietary CSV formats
> || Product || Strategy || Documentation / Link ||
> | PostgreSQL | If NULL should be preserved all non NULL values gets quoted | 
> [PostgreSQL 8.1 
> Manual|http://www.postgresql.org/docs/8.1/static/sql-copy.html] |
> | MySQL | NULL Values will be replaced by the letters NULL or escaped by \n | 
> not found, verified with MySQL Workbench | 
> | MS SQL | NULL values will be exported as empty strings (no quotes). Strings 
> will be quoted if needed. Import can interpret them as null | 
> [MSDN|http://msdn.microsoft.com/en-us//library/ms187887] | 
> | Oracle | NULL Values will be replaced by the letters NULL | 
> [Manual|http://docs.oracle.com/cd/B25329_01/doc/admin.102/b25107/impexp.htm] |

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to