|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Class Summary | |
|---|---|
| CSVFormat | Specifies the format of a CSV file and parses input. |
| CSVFormat.CSVFormatBuilder | Builds CSVFormat objects. |
| CSVParser | Parses CSV files according to the specified configuration. |
| CSVPrinter | Prints values in a CSV format. |
| CSVRecord | A CSV record parsed from a CSV file. |
| Enum Summary | |
|---|---|
| Quote | Defines quote behavior when printing. |
Apache Commons CSV Format Support.
CSV (or its dialects) are widely used as interfaces to legacy systems or manual data-imports. Basically CSV stands for "Comma Separated Values" but this simple abbreviation leads to more confusion than definitions.
Common to all file dialects is its basic structure: The CSV data-format is record oriented, whereas each record starts on a new textual line. A record is build of a list of values. Keep in mind that not all records must have an equal number of values:
csv := records*
record := values*
The following list contains the csv aspects the Commons CSV parser supports:
In addition to individually defined dialects, two predefined dialects (strict-csv, and excel-csv) can be set directly.
Example usage:
Reader in = new StringReader("a,b,c");
for (CSVRecord record : CSVFormat.DEFAULT.parse(in)) {
for (String field : record) {
System.out.print("\"" + field + "\", ");
}
System.out.println();
}
|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||