Menu

#41 converting of multiple csv inside one file to beans

v1.0 (example)
wont-fix
None
5
2016-08-19
2016-08-11
Jan Gregor
No

I plan to parse file that contains multiple csv parts to beans. A part is defined by #HEADER followed by definition of columns. Following rows that belongs to the part starts with HEADER column. Rows in parts aren't mixed.

Can be opencsv introspection and mapping be used to convert a row to bean in this case ? So to dynamically choose used mapping based on row content (in my case first column ?

Discussion

  • Andrew Rucker Jones

    No, it can't. As far as I know, you're the first person to request this feature.

    You might be able to write a new mapping strategy to do this, but the current interface MappingStrategy is probably not capable of accomodating this function.

    Let me know if you need anything else, otherwise I'll close this ticket in a few days. If you think this would be a really great feature to have in opencsv, and others would benefit from it as well, feel free to tell us that or, even better, submit a patch. Still, I must give you fair warning: I wouldn't expect to see this in opencsv very soon, if I were you, because if you don't submit a patch, none of the developers have loads of extra time to implement this, and if you do submit a patch, it must be with tests, documentation, and it must preserve backwards compatibility with everything we have so far. As I've said, I'm guessing that will be very difficult.

     
  • Andrew Rucker Jones

    • status: open --> wont-fix
    • assigned_to: Andrew Rucker Jones
     
  • Andrew Rucker Jones

    As always, patches and suggestions are still welcome, but I try to keep our ticket backlog clean, so since we haven't heard from you in a few days, I'm closing this ticket.

     

Log in to post a comment.

MongoDB Logo MongoDB