sitelink1 | http://ostermiller.org/utils/CSV.html |
---|---|
sitelink2 | |
sitelink3 | |
extra_vars4 | |
extra_vars5 | |
extra_vars6 |
Writing CSV files: CSVPrinter
CSVPrinter csvp = new CSVPrinter(
System.out
);
// Write to the printer
csvp.writeln(
new String[]{
"hello","world"
}
);
Reading CSV files: CSVParser
String[][] values = CSVParser.parse(
new StringReader(
"hello,worldn" +
"how,are,you"
)
); // Display the parsed data
for (int i=0; i<values.length; i++){
for (int j=0; j<values[i].length; j++){
System.out.println(values[i][j]);
}
System.out.println("-----");
}
기타 CSV 관련
Example
// Create the printerCSVPrinter csvp = new CSVPrinter(
System.out
);
// Write to the printer
csvp.writeln(
new String[]{
"hello","world"
}
);
Reading CSV files: CSVParser
Example
// Parse the dataString[][] values = CSVParser.parse(
new StringReader(
"hello,worldn" +
"how,are,you"
)
); // Display the parsed data
for (int i=0; i<values.length; i++){
for (int j=0; j<values[i].length; j++){
System.out.println(values[i][j]);
}
System.out.println("-----");
}
기타 CSV 관련
Author | License | Features |
---|---|---|
Stephen Ostermiller ostermillerutils CSV and ExcelCSV for Java | Open source, GPL | Parses CSV streams into Java Strings or arrays of Strings. |
Ricebridge CSV Manager | Commercial, with various license price points. | Parses CSV streams with callback methods when data is found. Single CSV parsing class can be configured to parse standard CSV, Excel CSV, or other user specified variants. |
E.Allen Soard Java CSV Library | Open source, LGPL | Parses CSV files into Java objects contained entirely in memory. |
Nilo de Roock xlSQL | Open source, GPL | Provides a JDBC interface for accessing CSV files. |
Bruce Dunwiddie CsvReader | Commercial, with various license price points. | Reads CSV files one line at a time and values may be obtained by name (similar to LabeledCSVParser) or by index. Single CSV parsing class can be configured to parse standard CSV, Excel CSV, or other user specified variants. A .Net version of the parser is also available. |