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

Emmanuel Bourg commented on CSV-85:
-----------------------------------

Assuming that inline comments are dropped, I would define a record comment as 
the concatenation of the comment lines preceding the current record in the file 
(up to the previous record).

1. The simple case, a one line comment:

{code}
# Comment
a,b,c,e,f
{code}

Expected record comment: "Comment" (the comment char and the leading space are 
removed)

2. A comment on multiple lines

{code:none}
# Very Long
# Comment
a,b,c,e,f
{code}

Expected record comment: "Very Long\nComment"

3. A comment on multiple lines, with blank lines interleaved

{code:none}
# Very Long

# Comment
a,b,c,e,f
{code}

Here the result depends on the empty line handling. If empty lines are ignored 
this is equivalent to the previous case. If empty lines are not ignored, this 
will produce two records, the first one with the comment "Very Long" and the 
second one with "Comment".
                
> Allow comments to be returned in CSVRecord
> ------------------------------------------
>
>                 Key: CSV-85
>                 URL: https://issues.apache.org/jira/browse/CSV-85
>             Project: Commons CSV
>          Issue Type: Improvement
>            Reporter: Sebb
>
> It might be useful to provide a comment field in the CSVRecord class.
> This would be null if no comment is present for that record.
> A line consisting of only a comment would have a size() of 0.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to