[
https://issues.apache.org/jira/browse/CSV-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473053#comment-15473053
]
Rodolfo Duldulao commented on CSV-195:
--------------------------------------
Here's the sample file contents:
{code}
indicator,nominatedInfoType,nominatedInfo,mobileNumber,firstName,middleName,lastName,suffix,dateOfBirth,amount,id,branch,category
a,SSS,1234567890,63**********,John,S,Devereaux,I,3/17/1986,80000,8510087650,Manila,A
a,GSIS,1234567891,63**********,Jolie,A,Noname,II,8/24/1948,30000,8510087651,Mandaluyong,B
a,TIN,1234567892,63**********,Jim,B,Lim,III,1/15/1952,40000,8510087652,Makati,C
u,SSS,1234567890,63**********,Tammy,S,Devereaux,I,8/2/1990,180000,8510087650,Manila,A
u,GSIS,1234567891,63**********,Earl,A,Noname,II,8/24/1948,190000,8510087651,Mandaluyong,B
u,TIN,1234567892,63**********,Clive,B,Lim,III,1/15/1952,200000,8510087652,Makati,C
u,SSS,1234567893,63**********,Mary,C,Quinto,IV,10/24/1947,210000,8510087653,Pasig,D
u,GSIS,1234567894,63**********,Paul,D,Jordan,V,6/24/1948,220000,8510087654,Manila,A
u,TIN,1234567895,63**********,Mike,E,Sanchez,VI,8/23/1949,230000,8510087655,Quezon,B
u,SSS,1234567896,63**********,Karl
Len,A,Dimla,VII,7/3/1950,240000,8510087656,Mandaluyong,C
u,GSIS,1234567897,63**********,Earl,B,James,VIII,6/7/1951,250000,8510087657,Makati,D
u,TIN,1234567898,63**********,Janice,D,Mason,IX,9John/5/1949,260000,8510087658,Pasig,A
u,SSS,1234567899,63**********,Owen,A,Manna,X,5/13/1950,270000,8510087659,Quezon,B
u,GSIS,1234567900,63**********,Lawrence,C,McAdams,XI,11/9/1951,280000,8510087660,Mandaluyong,C
u,TIN,1234567901,63**********,Rodney
Leo,E,Exupery,XII,10/18/1994,290000,8510087661,Pasig,A
d,SSS,1234567890,63**********,Tammy,S,Devereaux,I,8/2/1990,180000,8510087650,Manila,A
d,GSIS,1234567891,63**********,Earl,A,Noname,II,8/24/1948,190000,8510087651,Mandaluyong,B
d,TIN,1234567892,63**********,Clive,B,Lima,III,1/15/1952,200000,8510087652,Makati,C
d,SSS,1234567893,63**********,Mary,C,Quinto,IV,10/24/1947,210000,8510087653,Pasig,D
d,GSIS,1234567894,63**********,Paul,D,Jones,V,6/24/1948,220000,8510087654,Manila,A
d,TIN,1234567895,63**********,Mike,E,Sanchez,VI,8/23/1949,230000,8510087655,Quezon,B
d,SSS,1234567896,63**********,Karl
Len,A,Dimla,VII,7/3/1950,240000,8510087656,Mandaluyong,C
d,GSIS,1234567897,63**********,Earl,B,James,VIII,6/7/1951,250000,8510087657,Makati,D
d,TIN,1234567898,63**********,Janice,D,Mason,IX,9/5/1949,260000,8510087658,Pasig,A
d,SSS,1234567899,63**********,Bien,A,Mandac,X,5/13/1950,270000,8510087659,Quezon,B
d,GSIS,1234567900,63**********,Lawrence,C,McAdams,XI,11/9/1951,280000,8510087660,Mandaluyong,C
d,TIN,1234567901,63**********,Rodney
Leo,E,Exupery,XII,10/18/1994,290000,8510087661,Pasig,A
{code}
> Parser iterates over the last CSV Record twice.
> -----------------------------------------------
>
> Key: CSV-195
> URL: https://issues.apache.org/jira/browse/CSV-195
> Project: Commons CSV
> Issue Type: Bug
> Components: Parser
> Affects Versions: 1.4
> Environment: Mac OS X 10.10.5
> Reporter: Rodolfo Duldulao
>
> {code:java}
> class CSVParserSpecification extends Specification {
> def "TEst CSVParser"() {
> setup:
> URL url = new URL("https://....../csv_with_28_lines_header_plus_
> 27_records");
> BufferedReader reader = new BufferedReader(new
> InputStreamReader(url.openStream()));
> def CSVParser parser =
> CSVFormat.RFC4180.withFirstRecordAsHeader().withIgnoreEmptyLines().withTrim().parse(reader);
> when:
> def count = 0
> for (CSVRecord record: parser)
> { println("Processing " + parser.getCurrentLineNumber()) count++ }
> println(count);
> parser.close()
> then:
> count == 27
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)