Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread sebb
On 7 May 2013 15:40, Adrian Crum wrote: > From my perspective, it should be fairly easy to make it clear... > > 1. File is opened, but not processed. Current line number = 1, total lines > processed = 0, records processed = 0. I would say the current line number is also zero at this point; we hav

Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread Adrian Crum
From my perspective, it should be fairly easy to make it clear... 1. File is opened, but not processed. Current line number = 1, total lines processed = 0, records processed = 0. 2. First line is processed. Current line number = 2, lines processed = 1, records processed = 0. 3. Second line is p

Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread sebb
On 7 May 2013 11:36, Adrian Crum wrote: > Maybe the method could be named better, something like > ExtendedBufferedReader.getCurrentLineNumber() - which would be different > than total lines processed. > Indeed, but at present there is no method which accurately reports the current line number fo

Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread Adrian Crum
Maybe the method could be named better, something like ExtendedBufferedReader.getCurrentLineNumber() - which would be different than total lines processed. -Adrian On 5/7/2013 11:05 AM, sebb wrote: I've been looking at it further and there is an issue with 1-based counting. The line number c

Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread sebb
I've been looking at it further and there is an issue with 1-based counting. The line number currently counts the number of EOLs seen. This means it is currently accurate for total line count (which a 1-based system would not be) and is accurate for any completed records. It's only during process

Re: [CSV] change line number from 0-based to 1-based

2013-05-07 Thread Benedikt Ritter
2013/5/6 Gary Gregory > On Mon, May 6, 2013 at 5:49 PM, sebb wrote: > > > The line number returned by > > > > ExtendedBufferedReader.getLineNumber() > > > > currently starts at zero, so an error in the first line in the file is > > reported as being in line 0. > > > > There does not seem to be a

Re: [CSV] change line number from 0-based to 1-based

2013-05-06 Thread Gary Gregory
I think there is also a record count that should be consistent with 1-based indexing if it is not already. Gary On May 6, 2013, at 18:19, sebb wrote: > I've just noticed that its Javadoc is inconsistent/ambiguous: > >/** > * Returns the number of lines read > * > * @return the c

Re: [CSV] change line number from 0-based to 1-based

2013-05-06 Thread sebb
I've just noticed that its Javadoc is inconsistent/ambiguous: /** * Returns the number of lines read * * @return the current-line-number (or -1) */ "Number of lines read" - I assume that is zero until the first complete line has been read, i.e. 0-based. "Current-line-numbe

Re: [CSV] change line number from 0-based to 1-based

2013-05-06 Thread Gary Gregory
On Mon, May 6, 2013 at 5:49 PM, sebb wrote: > The line number returned by > > ExtendedBufferedReader.getLineNumber() > > currently starts at zero, so an error in the first line in the file is > reported as being in line 0. > > There does not seem to be any good reason for using a zero-based line

[CSV] change line number from 0-based to 1-based

2013-05-06 Thread sebb
The line number returned by ExtendedBufferedReader.getLineNumber() currently starts at zero, so an error in the first line in the file is reported as being in line 0. There does not seem to be any good reason for using a zero-based line number, so I would like to change it to 1-based. Some tests