Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6C7F11959 for ; Wed, 27 Aug 2014 13:36:59 +0000 (UTC) Received: (qmail 78296 invoked by uid 500); 27 Aug 2014 13:36:59 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 78197 invoked by uid 500); 27 Aug 2014 13:36:59 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 77933 invoked by uid 99); 27 Aug 2014 13:36:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2014 13:36:58 +0000 Date: Wed, 27 Aug 2014 13:36:58 +0000 (UTC) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CSV-128) Ignore empty Excel column names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CSV-128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Gregory updated CSV-128: ----------------------------- Summary: Ignore empty Excel column names (was: Ignore empty Excell column names) > Ignore empty Excel column names > ------------------------------- > > Key: CSV-128 > URL: https://issues.apache.org/jira/browse/CSV-128 > Project: Commons CSV > Issue Type: Bug > Components: Parser > Affects Versions: 1.0 > Environment: Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T16:58:10-04:00) > Maven home: C:\Java\apache-maven-3.2.3 > Java version: 1.7.0_65, vendor: Oracle Corporation > Java home: C:\Program Files\Java\jdk1.7.0_65\jre > Default locale: en_US, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" > Reporter: Gary Gregory > Fix For: Patch Needed > > > I have an Excel file with a first row with N column names > If there are additional columns that are not labeled, Excel exports empty columns. For example: > A,B,C,, > a,b,c,d,e > This causes an IAE like: > {noformat} > java.lang.IllegalArgumentException: The header contains a duplicate name: "" in [A, B, C, , ] > at org.apache.commons.csv.CSVParser.initializeHeader(CSVParser.java:368) > at org.apache.commons.csv.CSVParser.(CSVParser.java:248) > at org.apache.commons.csv.CSVParser.parse(CSVParser.java:206) > {noformat} > It seems like the simplest solution is to ignore empty column names, such that they cannot be addressable and not attempt to index them. -- This message was sent by Atlassian JIRA (v6.2#6252)