commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SANDBOX-242) Encapsulated csv line strategy
Date Sat, 12 Nov 2011 00:48:53 GMT

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

Emmanuel Bourg commented on SANDBOX-242:
----------------------------------------

You simply have to run it twice through Commons CSV, the result will be:

{code}[, AD, ALV, Andorra la Vella, Andorra la Vella, , --34-6--, AI, 0601, , 4230N 00131E,
]{code}

Here is the code I used:

{code}String string1 = ...

CSVFormat format = CSVFormat.DEFAULT;
String string2 = new CSVParser(new StringReader(string1), format).getLine()[0];

String[] result = new CSVParser(new StringReader(string2), format).getLine();
{code}
                
> Encapsulated csv line strategy
> ------------------------------
>
>                 Key: SANDBOX-242
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-242
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: CSV
>            Reporter: marc schipperheyn
>            Priority: Minor
>             Fix For: CSV 1.x
>
>
> I ran into this csv file :
> {code}
> ",""AD"",""ALV"",""Andorra la Vella"",""Andorra la Vella"",,""--34-6--"",""AI"",""0601"",,""4230N
00131E"","""""
> {code}
> It basically and weirdly encapsulates an entire line in " as a sort of record identifier
and has double "" to identify values
> I'm having difficulty finding a tool that can parse this easily.

--
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

        

Mime
View raw message