mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-06 01:59:07 +00:00
Better example.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0d91d205d
commit
816c652997
@ -25,13 +25,14 @@ limitations under the License.
|
||||
<section name="Using Commons CSV">
|
||||
<p>Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.</p>
|
||||
<p>To parse an Excel CSV file, write:</p>
|
||||
<source>Reader in = ...;
|
||||
<source>Reader in = new FileReader("path/to/file.csv");
|
||||
Iterable<CSVRecord> parser = CSVFormat.EXCEL.parse(in);
|
||||
for (CSVRecord record : parser) {
|
||||
...
|
||||
String lastName = record.get("Last Name");
|
||||
String firstName = record.get("First Name");
|
||||
}</source>
|
||||
<p>Other formats are available, please consult the Javadoc for <a href="apidocs/org/apache/commons/csv/CSVFormat.html">CSVFormat</a> and
|
||||
<a href="apidocs/org/apache/commons/csv/CSVParser.html">CSVParser</a></p>
|
||||
<a href="apidocs/org/apache/commons/csv/CSVParser.html">CSVParser</a>.</p>
|
||||
</section>
|
||||
|
||||
<section name="Getting the code">
|
||||
|
Loading…
x
Reference in New Issue
Block a user