commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject Re: [CSV] Headers and the first record
Date Tue, 30 Jul 2013 21:24:27 GMT
On Tue, Jul 30, 2013 at 5:15 PM, Emmanuel Bourg <> wrote:

> I haven't checked the current code, but the intended behavior was:
> - no args: the first record defines the header and is not returned when
> iterating
> - args: the header is defined independently of the data, all the records
> are returned when iterating

Yeah, that's too clever IMO. I expected the same behavior WRT record
reading with the only difference being if I let the parser guess or not.

The current code now always reads the header line if you set any non-null
header. If you call withHeader() with no args it is a non-null call with an
empty String[].

The idea being that if I use headers and I ask the parser to guess or give
it the headers, I do not need to have the header line as a record.

I plan on adding a setting that allows the header record to be saved for
callers who care.


> Emmanuel Bourg
> Le 30/07/2013 22:23, Gary Gregory a écrit :
> > Actually, if you use withHeader(), no args, you _cannot_ get back the
> first
> > record, so that makes skipHeader=false not possible without making the
> > parser track the first record separately.
> >
> > In the interest of simplicity, I am going to make it simple: if you use
> > withHeader of any kind, then the first record is read.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

E-Mail: |
Java Persistence with Hibernate, Second Edition<>
JUnit in Action, Second Edition <>
Spring Batch in Action <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message