Use 4 spaces indentation in examples
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1610770 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8fdcb3da11
commit
5e60966b56
|
@ -27,8 +27,8 @@ limitations under the License.
|
||||||
<source>Reader in = new FileReader("path/to/file.csv");
|
<source>Reader in = new FileReader("path/to/file.csv");
|
||||||
Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(in);
|
Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(in);
|
||||||
for (CSVRecord record : records) {
|
for (CSVRecord record : records) {
|
||||||
String lastName = record.get("Last Name");
|
String lastName = record.get("Last Name");
|
||||||
String firstName = record.get("First Name");
|
String firstName = record.get("First Name");
|
||||||
}</source>
|
}</source>
|
||||||
</section>
|
</section>
|
||||||
<section name="Handling Byte Order Marks">
|
<section name="Handling Byte Order Marks">
|
||||||
|
@ -42,13 +42,13 @@ for (CSVRecord record : records) {
|
||||||
final Reader reader = new InputStreamReader(new BOMInputStream(url.openStream()), "UTF-8");
|
final Reader reader = new InputStreamReader(new BOMInputStream(url.openStream()), "UTF-8");
|
||||||
final CSVParser parser = new CSVParser(reader, CSVFormat.EXCEL.withHeader());
|
final CSVParser parser = new CSVParser(reader, CSVFormat.EXCEL.withHeader());
|
||||||
try {
|
try {
|
||||||
for (final CSVRecord record : parser) {
|
for (final CSVRecord record : parser) {
|
||||||
final String string = record.get("SomeColumn");
|
final String string = record.get("SomeColumn");
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
parser.close();
|
parser.close();
|
||||||
reader.close();
|
reader.close();
|
||||||
}</source>
|
}</source>
|
||||||
</section>
|
</section>
|
||||||
<!-- ================================================== -->
|
<!-- ================================================== -->
|
||||||
|
|
Loading…
Reference in New Issue