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:
Gary D. Gregory 2013-07-31 20:03:02 +00:00
parent c0d91d205d
commit 816c652997

View File

@ -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(&quot;path/to/file.csv&quot;);
Iterable&lt;CSVRecord&gt; 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">