diff --git a/src/site/site.xml b/src/site/site.xml index 4b598d4d..846686d4 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -29,6 +29,7 @@ + diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index 20b11df3..340339b8 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -24,38 +24,30 @@ limitations under the License.

Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.

-

To parse an Excel CSV file, write:

- Reader in = new FileReader("path/to/file.csv"); -Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(in); -for (CSVRecord record : records) { - String lastName = record.get("Last Name"); - String firstName = record.get("First Name"); -} -

Other formats are available, please consult the Javadoc for CSVFormat and - CSVParser. +

The most common CSV formats are predefined in the CSVFormat class: +

+

Custom formats can be created using a fluent style API.

-
+ +

- To handle files that start with a Byte Order Mark (BOM) like some Excel CSV files, you need an extra step to deal with these optional bytes. - You can use the - BOMInputStream - class from Apache Commons IO for example: + The package descriptions in the JavaDoc give an overview of the available features + and various project reports are provided. +

+

+ The JavaDoc API documents for the current stable release 1.0 [Java 5.0+] can be viewed in a web browser. +

+

+ The subversion repository can be + browsed, or you can browse/contribute via GitHub.

- final URL url = ...; -final Reader reader = new InputStreamReader(new BOMInputStream(url.openStream()), "UTF-8"); -final CSVParser parser = new CSVParser(reader, CSVFormat.EXCEL.withHeader()); -try { - for (final CSVRecord record : parser) { - final String string = record.get("SomeColumn"); - ... - } -} finally { - parser.close(); - reader.close(); -}
-

The latest stable release of csv is 1.0. You may: