Last updated June 30, 2011 06:18, by Arne Burmeister
Feedicon  

How should Diergo CSV be used?

The most simple way are the static methods of CommaSeparatedValues.

To parse CSV from a reader:

import static diergo.csv.CommaSeparatedValues.parse;

...

  Reader csv = ...;
  for (String[] row : parse(csv)) {
    // do whatever you want with the values of the row.  
  }
  csv,close();

To write CSV to a writer:

import static diergo.csv.CommaSeparatedValues.generate;

...

  Writer csv = ...;
  Iterable<String[]> rows = ...;
  generate(rows, ',', csv);
  csv,close();

For more information, have a look at the API. Diergo CSV is based on Diergo Utils.

  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close