Menu

#32 Proposal for comment line event handler

2.1.0
closed
None
1
2015-01-24
2013-04-25
Feng Dihai
No

Since V2.1.0 CsvPreference can define a CommentMatcher to direct csv reader to skip comment lines (like never existed). Sometime comment line can include hint/instruction that will effect how to parse coming lines.

It is helpful to implement something like comment-line event handler, inside which hint/instruction can be retrieved rather than discard it.

Discussion

  • James Bassett

    James Bassett - 2013-04-25

    Ticket moved from /p/supercsv/bugs/41/

     
  • James Bassett

    James Bassett - 2013-04-25

    That's an interesting idea, but I'm curious what kind of 'instructions' the comments would have and how the processing would change (different processors? mapping to a different bean class?). Can you give some examples (CSV)?

     
  • Feng Dihai

    Feng Dihai - 2013-04-26

    Giving an example, we are developing an Eclipse RCP application with multi-locale support, which can import CSV file modified and saved in Excel by users. Number format symbols (or decimal mark, see http://en.wikipedia.org/wiki/Decimal_mark) can vary in different area around the world. To make sure to parse formatted number correctly, user can insert a comment line to instruct how to parse coming lines.

    Here is a supposed sample CSV:
    <HR>

    # DECIMAL_POINT = ,
    # GRROUP_MARK = SPACE
    A, B, C, "1 234,45"
    ... ...
    
     

    Last edit: Feng Dihai 2013-04-26
  • James Bassett

    James Bassett - 2015-01-24
    • status: open --> closed
     

Log in to post a comment.