Skip to content

Commit 816c652

Browse files
committed
Better example.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509012 13f79535-47bb-0310-9956-ffa450edef68
1 parent c0d91d2 commit 816c652

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/site/xdoc/index.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ limitations under the License.
2525
<section name="Using Commons CSV">
2626
<p>Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.</p>
2727
<p>To parse an Excel CSV file, write:</p>
28-
<source>Reader in = ...;
28+
<source>Reader in = new FileReader(&quot;path/to/file.csv&quot;);
2929
Iterable&lt;CSVRecord&gt; parser = CSVFormat.EXCEL.parse(in);
3030
for (CSVRecord record : parser) {
31-
...
31+
String lastName = record.get("Last Name");
32+
String firstName = record.get("First Name");
3233
}</source>
3334
<p>Other formats are available, please consult the Javadoc for <a href="apidocs/org/apache/commons/csv/CSVFormat.html">CSVFormat</a> and
34-
<a href="apidocs/org/apache/commons/csv/CSVParser.html">CSVParser</a></p>
35+
<a href="apidocs/org/apache/commons/csv/CSVParser.html">CSVParser</a>.</p>
3536
</section>
3637

3738
<section name="Getting the code">

0 commit comments

Comments
 (0)