commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@apache.org>
Subject Re: [CSV] Headers and the first record
Date Wed, 31 Jul 2013 13:34:28 GMT
Le 31/07/2013 15:08, Gary Gregory a écrit :

> But that is exactly what _was_ happening! ;)
> 
> If I called withHeader("A", "B", "C") the header was not skipped.

Sounds good. The header is defined in the code, we don't expect to see
the header in the file so nothing is skipped.

> If I called withHeader(new String[]{}) the header was skipped.

Correct. The header is not defined in the code, the parser uses the
first record as header and doesn't return it when iterating.

> If I called withHeader() the header was skipped (same as line above).

Sounds good too.


What was the issue again ? ;)


> What I am asking is: should we have a saveHeader setting such that IF you
> ask for headers, then we save that record in the parser, it is currently
> "lost", or, actually transformed into the header map.

Keeping the header around might be useful, I wouldn't create a format
parameter for this though. It could be made available at the record
level, much like ResultSet.getMetaData().

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message