And another thing: internally, the header should be a Set<String>, not a String[]. I plan on fixing that later too.
Gary On Tue, Jul 30, 2013 at 5:24 PM, Gary Gregory <garydgreg...@gmail.com>wrote: > On Tue, Jul 30, 2013 at 5:15 PM, Emmanuel Bourg <ebo...@apache.org> 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. > > Gary > > >> >> 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: dev-unsubscr...@commons.apache.org >> For additional commands, e-mail: dev-h...@commons.apache.org >> >> > > > -- > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org > Java Persistence with Hibernate, Second > Edition<http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory > -- E-Mail: garydgreg...@gmail.com | ggreg...@apache.org Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory