You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/09/06 13:56:00 UTC

[jira] [Commented] (CSV-304) Provide access methods for header and trailer comments

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

Gary D. Gregory commented on CSV-304:
-------------------------------------

Hello [~peterhull90] 

Please submit any contribution as a PR on GitHub; this will allow the CI to build your changes.

> Provide access methods for header and trailer comments
> ------------------------------------------------------
>
>                 Key: CSV-304
>                 URL: https://issues.apache.org/jira/browse/CSV-304
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Parser
>    Affects Versions: 1.9.0
>            Reporter: Peter Hull
>            Priority: Minor
>             Fix For: Discussion
>
>         Attachments: header-comment.patch
>
>
> The Apache Commons CSV library can deal with comments by attaching the comment to the following record.
> It does not seem possible to access comments that are before the header line ("header comments"), or after the last record ("trailer comments")
> I feel this would be a useful enhancement to the current comment-handling features of version 1.9.
> I have not been able to find mention of this in other JIRA tickets.
> I have attached a patch implementing this, for discussion purposes. (n.b. I had trouble with git showing spurious ^M at the end of changed lines in CSVParserTest.java which I could not get rid of)
> This adds methods String CSVParser::getHeaderComment(), String CSVParser::getTrailerComment(), bool CSVParser::hasHeaderComment() and bool CSVParser::hasTrailerComment() . The last two could be omitted assuming a missing comment would return a null String.
>  
> See also [https://stackoverflow.com/questions/72619095/get-leading-comments-from-csv-with-apache-commons-csv] and [https://lists.apache.org/thread/8tczpqlnjgbcyovyhb484tt11vqv91jt]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)