Eric K. Sender created CSV-236:
----------------------------------
Summary: Allow duplicate headers in CSV File
Key: CSV-236
URL: https://issues.apache.org/jira/browse/CSV-236
Project: Commons CSV
Issue Type: Improvement
Components: Parser
Affects Versions: Discussion
Reporter: Eric K. Sender
Currently if a CSV file has a duplicate column header, a runtime exception is
thrown:
[https://github.com/apache/commons-csv/blob/546fd69eaa6b3fd2c9da8b4222a3822f1ab53abd/src/main/java/org/apache/commons/csv/CSVParser.java#L492]
I think that may be a bit harsh reaction, as there could be some columns whose
data is relative to its column order. I understand the header map uses the
column name as the key, however I anticipate one could flip the map to be a
Map<Integer, String> so its column number is the key.
Anyway I am curious what the genesis of this decision was to use column headers
as the key and if it's worthwhile to flip the map and allow for duplicate
column names.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)