Menu

#47 Add iterate method to CsvToBean

Unstable (example)
closed
nobody
5
2016-05-22
2013-02-19
No

Currently, CsvToBean has only a method that reads all lines of csv and returns a list.
This patch add a new method that takes same parameters than parse, but returns an iterator.

This method allows to use CsvToBean on large file without consume too many memory.

Related

Patches: #47

Discussion

  • Clement Cunin

    Clement Cunin - 2013-02-19
     
  • george

    george - 2015-07-27

    Hi I'm also in need of the iterator function, is there any chance this patch will ever make it into the next version? CsvToBean works great, but when we have very large files, it would be much better if we could iterate line by line rather than throwing everything into a list.

     
    • Scott Conway

      Scott Conway - 2015-07-27

      I will look at your patch later this week. This part of the year is hectic
      with work/kids/school/scouts so I cannot give an ETA on 3.5 openCSV.

      Plus I am getting murdered with the CSVReader isClosed issue: it is either
      failing for people who use nio libraries or it is failing for people using
      the standard stream reader - I cannot find a solution that will work for
      both. That has the highest priority right now.

      On Mon, Jul 27, 2015 at 8:14 AM, george gchristman@users.sf.net wrote:

      Hi I'm also in need of the iterator function, is there any chance this
      patch will ever make it into the next version? CsvToBean works great, but
      when we have very large files, it would be much better if we could iterate
      line by line rather than throwing everything into a list.


      Status: open
      Group:
      Labels: new functionality
      Created: Tue Feb 19, 2013 03:08 PM UTC by Clement Cunin
      Last Updated: Tue Feb 19, 2013 03:08 PM UTC
      Owner: nobody

      Currently, CsvToBean has only a method that reads all lines of csv and
      returns a list.
      This patch add a new method that takes same parameters than parse, but
      returns an iterator.

      This method allows to use CsvToBean on large file without consume too many
      memory.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/opencsv/patches/47/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Scott Conway
      scott.conway@gmail.com
      http://www.conwayfamily.name

       

      Related

      Patches: #47

      • george

        george - 2015-07-27

        I'm currently using my own implementation of CsvToBean with the patch and
        it appears to work flawlessly. It should be a simple 5min patch for you.
        Thank you so much for all your hard work.
        On Jul 27, 2015 12:44 PM, "Scott Conway" sconway@users.sf.net wrote:

        I will look at your patch later this week. This part of the year is hectic
        with work/kids/school/scouts so I cannot give an ETA on 3.5 openCSV.

        Plus I am getting murdered with the CSVReader isClosed issue: it is either
        failing for people who use nio libraries or it is failing for people using
        the standard stream reader - I cannot find a solution that will work for
        both. That has the highest priority right now.

        On Mon, Jul 27, 2015 at 8:14 AM, george gchristman@users.sf.net wrote:

        Hi I'm also in need of the iterator function, is there any chance this
        patch will ever make it into the next version? CsvToBean works great, but
        when we have very large files, it would be much better if we could iterate
        line by line rather than throwing everything into a list.


        Status: open
        Group:
        Labels: new functionality
        Created: Tue Feb 19, 2013 03:08 PM UTC by Clement Cunin
        Last Updated: Tue Feb 19, 2013 03:08 PM UTC
        Owner: nobody

        Currently, CsvToBean has only a method that reads all lines of csv and
        returns a list.
        This patch add a new method that takes same parameters than parse, but
        returns an iterator.

        This method allows to use CsvToBean on large file without consume too many
        memory.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/opencsv/patches/47/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

        --
        Scott Conway
        scott.conway@gmail.com
        http://www.conwayfamily.name


        Status: open
        Group:
        Labels: new functionality
        Created: Tue Feb 19, 2013 03:08 PM UTC by Clement Cunin
        Last Updated: Mon Jul 27, 2015 01:14 PM UTC
        Owner: nobody

        Currently, CsvToBean has only a method that reads all lines of csv and
        returns a list.
        This patch add a new method that takes same parameters than parse, but
        returns an iterator.

        This method allows to use CsvToBean on large file without consume too many
        memory.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/opencsv/patches/47/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Patches: #47

  • Andrew Rucker Jones

    • status: open --> closed
    • Group: --> Unstable (example)
     
  • Andrew Rucker Jones

    It appears to me this need has long since been met by IterableCSVToBean. It iterates, and it works on a line-by-line basis instead of reading everything into memory at once. I'm closing this ticket. If I am mistaken, simply post a comment to this ticket and I will reopen it and examine it.

     

Log in to post a comment.

MongoDB Logo MongoDB