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

Sebb commented on CSV-167:
--------------------------

It's clear from the isComment() method (and the Javadoc for the comment field) 
that comments are only available as part of an existing data line.

If the intention had been for comments to be handled as separate records, then 
the comment marker would have been a boolean or it would not have been possible 
to have both comment and data in the same record, or there would have been a 
separate comment record type.

This is not the case.

Yes, it could originally have been done the way you want, but it was not, and 
changing it now is not feasible without breaking the behaviour which has been 
present since version 1.0.
The only way to change the behaviour would be to make it yet another parsing 
option. I personally don't think it's worth the effort. 

Comments are not a fundamental part of CSV parsing; it's at least possible to 
process them. If you want additional comment handling then write a 
pre-processor.

Note: I have just noticed that isComment() was added since 1.2 so we can change 
that without needing to deprecate it.

> Comment line hides next record
> ------------------------------
>
>                 Key: CSV-167
>                 URL: https://issues.apache.org/jira/browse/CSV-167
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.2
>            Reporter: Rene
>         Attachments: CSVProcessor.java, sample1.csv
>
>
> 1. First CSV record after the comment line is not processed at all (record #2 
> and #7)
> 2. Second/Third line after the first comment line are not recognized as 
> comment lines (record #5 and #6)
> See attached example!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to