commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CSV-112) HeaderMap is inconsistent when it is parsed from an input with duplicate columns names
Date Thu, 14 Aug 2014 20:08:27 GMT

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

Benedikt Ritter closed CSV-112.
-------------------------------


> HeaderMap is inconsistent when it is parsed from an input with duplicate columns names
> --------------------------------------------------------------------------------------
>
>                 Key: CSV-112
>                 URL: https://issues.apache.org/jira/browse/CSV-112
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.0
>            Reporter: Romain Gossé
>            Assignee: Benedikt Ritter
>              Labels: headers, parsing
>             Fix For: 1.0
>
>
> Given a parser format for csv files with a header line:
> {code}
> CSVFormat myFormat = CSVFormat.RFC4180.withDelimiter(",").withQuoteChar('"').withQuotePolicy(Quote.MINIMAL)
> 				.withIgnoreSurroundingSpaces(true).withHeader().withSkipHeaderRecord(true);
> {code}
> And given a file with duplicate header names:
>  
> Col1,Col2,Col2,Col3,Col4
> 1,2,3,4,5
> 4,5,6,7,8 
> The HeaderMap returned by the parser misses an entry because of the Column name being
used as a key, leading to wrong behavior when we rely on it.
> If this is not supposed to happen in the file regarding the CSV format, at least this
should raise an error. If not we should come up with a more clever way to store and access
the headers.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message