commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodolfo Duldulao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CSV-195) Parser iterates over the last CSV Record twice.
Date Thu, 08 Sep 2016 11:43:21 GMT

    [ https://issues.apache.org/jira/browse/CSV-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473633#comment-15473633
] 

Rodolfo Duldulao commented on CSV-195:
--------------------------------------

I viewed the files in vim and did a :set list .  The original file lines all had end of line
markers ($) so safe to say EOL char delimits all the lines in the file.  No other special
chars.

> 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
>             Fix For: Patch Needed
>
>         Attachments: whitelist.csv
>
>
> {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)

Mime
View raw message