You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by gg...@apache.org on 2025/03/19 22:20:07 UTC
svn commit: r1089465 [34/43] - in /websites/production/commons/content/proper/commons-csv: ./ apidocs/ apidocs/legal/ apidocs/org/apache/commons/csv/ apidocs/org/apache/commons/csv/class-use/ apidocs/resource-files/ apidocs/resources/ apidocs/script-di...
Modified: websites/production/commons/content/proper/commons-csv/taglist.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/taglist.html (original)
+++ websites/production/commons/content/proper/commons-csv/taglist.html Wed Mar 19 22:20:06 2025
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!--
- | Generated by Apache Maven Doxia Site Renderer 2.0.0 from org.codehaus.mojo:taglist-maven-plugin:3.2.1:taglist at 13 Jan 2025
+ | Generated by Apache Maven Doxia Site Renderer 2.0.0 from org.codehaus.mojo:taglist-maven-plugin:3.2.1:taglist at 19 Mar 2025
| Rendered using Apache Commons Skin
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Tag List report â Commons CSV</title>
+ <title>Tag List report â Apache Commons CSV</title>
<link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="./css/site.css" type="text/css" />
@@ -28,7 +28,7 @@
</a>
<a href="index.html" id="bannerRight">
<img class="logo-right" src=" images/logo.png
-" alt="Apache Commons CSV™ logo"/>
+" alt="Commons CSV"/>
</a>
<div class="clear"></div>
@@ -37,8 +37,8 @@
<div class="container-fluid">
<a class="brand" href="https://commons.apache.org/proper/commons-csv/">Apache Commons CSV ™</a>
<ul class="nav">
- <li id="publishDate">Last Published: 11 Jan 2025</li>
- <li class="divider">|</li> <li id="projectVersion">Version: 1.13.1-SNAPSHOT</li>
+ <li id="publishDate">Last Published: 15 Mar 2025</li>
+ <li class="divider">|</li> <li id="projectVersion">Version: 1.14.0</li>
</ul>
<div class="pull-right"> <ul class="nav">
<li>
@@ -67,47 +67,52 @@
<ul class="nav nav-list">
<li class="nav-header">Commons CSV</li>
<li class="none">
- <a href="index.html" title="Overview">
- Overview</a>
+ <a href="index.html" title="About">
+ About</a>
</li>
<li class="none">
- <a href="download_csv.cgi" title="Download">
- Download</a>
+ <a href="mail-lists.html" title="Asking Questions">
+ Asking Questions</a>
+ </li>
+ <li class="none">
+ <a href="changes.html" title="Release History">
+ Release History</a>
</li>
<li class="none">
- <a href="user-guide.html" title="User Guide">
- User Guide</a>
+ <a href="issue-management.html" title="Issue Tracking">
+ Issue Tracking</a>
+ </li>
+ <li class="none">
+ <a href="dependency-info.html" title="Dependency Management">
+ Dependency Management</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="Javadoc">
Javadoc</a>
</li>
<li class="none">
- <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/latest/index.html" class="externalLink" title="Javadoc Archive">
+ <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/" class="externalLink" title="Javadoc Archive">
Javadoc Archive</a>
</li>
<li class="none">
- <a href="changes.html" title="Release History">
- Release History</a>
+ <a href="scm.html" title="Sources">
+ Sources</a>
</li>
- </ul>
- <ul class="nav nav-list">
- <li class="nav-header">Development</li>
- <li class="none">
- <a href="mail-lists.html" title="Mailing Lists">
- Mailing Lists</a>
+ <li class="none">
+ <a href="security.html" title="Security">
+ Security</a>
</li>
<li class="none">
- <a href="issue-tracking.html" title="Issue Tracking">
- Issue Tracking</a>
+ <a href="https://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License">
+ License</a>
</li>
<li class="none">
- <a href="team.html" title="Team">
- Team</a>
+ <a href="https://www.apache.org/foundation/policies/conduct.html" class="externalLink" title="Code of Conduct">
+ Code of Conduct</a>
</li>
<li class="none">
- <a href="scm.html" title="Source">
- Source</a>
+ <a href="download_bcel.cgi" title="Download">
+ Download</a>
</li>
</ul>
<ul class="nav nav-list">
@@ -312,13 +317,13 @@
<th>Line</th></tr>
<tr class="b">
<td>this may lead to strange behavior, throw an exception if iterator() has already been called?</td>
-<td><a href="./xref-test/org/apache/commons/csv/CSVParserTest.html#L1270">1270</a></td></tr>
+<td><a href="./xref-test/org/apache/commons/csv/CSVParserTest.html#L1315">1315</a></td></tr>
<tr class="a">
<th>org.apache.commons.csv.CSVPrinter</th>
<th>Line</th></tr>
<tr class="b">
<td>Is it a good idea to do this here instead of on the first call to a print method? It seems a pain to have to track whether the header has already been printed or not.</td>
-<td><a href="./xref/org/apache/commons/csv/CSVPrinter.html#L112">112</a></td></tr>
+<td><a href="./xref/org/apache/commons/csv/CSVPrinter.html#L109">109</a></td></tr>
<tr class="a">
<th>org.apache.commons.csv.Lexer</th>
<th>Line</th></tr>
@@ -339,13 +344,13 @@
<th>Line</th></tr>
<tr class="a">
<td>is this correct? Do we expect <esc>BACKSPACE to be unescaped?</td>
-<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L214">214</a></td></tr>
+<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L226">226</a></td></tr>
<tr class="b">
<td>is this correct? Do we expect <esc>FF to be unescaped?</td>
-<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L250">250</a></td></tr>
+<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L262">262</a></td></tr>
<tr class="a">
<td>is this correct? Do we expect <esc>TAB to be unescaped?</td>
-<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L272">272</a></td></tr></table></section></section>
+<td><a href="./xref-test/org/apache/commons/csv/LexerTest.html#L284">284</a></td></tr></table></section></section>
</td>
</tr>
</table>
Modified: websites/production/commons/content/proper/commons-csv/team.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/team.html (original)
+++ websites/production/commons/content/proper/commons-csv/team.html Wed Mar 19 22:20:06 2025
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!--
- | Generated by Apache Maven Doxia Site Renderer 2.0.0 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.8.0:team at 13 Jan 2025
+ | Generated by Apache Maven Doxia Site Renderer 2.0.0 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.8.0:team at 19 Mar 2025
| Rendered using Apache Commons Skin
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Project Team â Commons CSV</title>
+ <title>Project Team â Apache Commons CSV</title>
<link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="./css/site.css" type="text/css" />
@@ -28,7 +28,7 @@
</a>
<a href="index.html" id="bannerRight">
<img class="logo-right" src=" images/logo.png
-" alt="Apache Commons CSV™ logo"/>
+" alt="Commons CSV"/>
</a>
<div class="clear"></div>
@@ -37,8 +37,8 @@
<div class="container-fluid">
<a class="brand" href="https://commons.apache.org/proper/commons-csv/">Apache Commons CSV ™</a>
<ul class="nav">
- <li id="publishDate">Last Published: 11 Jan 2025</li>
- <li class="divider">|</li> <li id="projectVersion">Version: 1.13.1-SNAPSHOT</li>
+ <li id="publishDate">Last Published: 15 Mar 2025</li>
+ <li class="divider">|</li> <li id="projectVersion">Version: 1.14.0</li>
</ul>
<div class="pull-right"> <ul class="nav">
<li>
@@ -67,47 +67,52 @@
<ul class="nav nav-list">
<li class="nav-header">Commons CSV</li>
<li class="none">
- <a href="index.html" title="Overview">
- Overview</a>
+ <a href="index.html" title="About">
+ About</a>
</li>
<li class="none">
- <a href="download_csv.cgi" title="Download">
- Download</a>
+ <a href="mail-lists.html" title="Asking Questions">
+ Asking Questions</a>
</li>
<li class="none">
- <a href="user-guide.html" title="User Guide">
- User Guide</a>
+ <a href="changes.html" title="Release History">
+ Release History</a>
+ </li>
+ <li class="none">
+ <a href="issue-management.html" title="Issue Tracking">
+ Issue Tracking</a>
+ </li>
+ <li class="none">
+ <a href="dependency-info.html" title="Dependency Management">
+ Dependency Management</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="Javadoc">
Javadoc</a>
</li>
<li class="none">
- <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/latest/index.html" class="externalLink" title="Javadoc Archive">
+ <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/" class="externalLink" title="Javadoc Archive">
Javadoc Archive</a>
</li>
<li class="none">
- <a href="changes.html" title="Release History">
- Release History</a>
+ <a href="scm.html" title="Sources">
+ Sources</a>
</li>
- </ul>
- <ul class="nav nav-list">
- <li class="nav-header">Development</li>
- <li class="none">
- <a href="mail-lists.html" title="Mailing Lists">
- Mailing Lists</a>
+ <li class="none">
+ <a href="security.html" title="Security">
+ Security</a>
</li>
<li class="none">
- <a href="issue-tracking.html" title="Issue Tracking">
- Issue Tracking</a>
+ <a href="https://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License">
+ License</a>
</li>
- <li class="none active">
- <a href="team.html" title="Team">
- Team</a>
+ <li class="none">
+ <a href="https://www.apache.org/foundation/policies/conduct.html" class="externalLink" title="Code of Conduct">
+ Code of Conduct</a>
</li>
<li class="none">
- <a href="scm.html" title="Source">
- Source</a>
+ <a href="download_bcel.cgi" title="Download">
+ Download</a>
</li>
</ul>
<ul class="nav nav-list">
Modified: websites/production/commons/content/proper/commons-csv/user-guide.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/user-guide.html (original)
+++ websites/production/commons/content/proper/commons-csv/user-guide.html Wed Mar 19 22:20:06 2025
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<!--
- | Generated by Apache Maven Doxia Site Renderer 2.0.0 from src/site/xdoc/user-guide.xml at 13 Jan 2025
+ | Generated by Apache Maven Doxia Site Renderer 2.0.0 from src/site/xdoc/user-guide.xml at 19 Mar 2025
| Rendered using Apache Commons Skin
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -8,7 +8,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="Apache Commons Documentation Team" />
- <title>User Guide â Commons CSV</title>
+ <title>User Guide â Apache Commons CSV</title>
<link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="./css/site.css" type="text/css" />
@@ -29,7 +29,7 @@
</a>
<a href="index.html" id="bannerRight">
<img class="logo-right" src=" images/logo.png
-" alt="Apache Commons CSV™ logo"/>
+" alt="Commons CSV"/>
</a>
<div class="clear"></div>
@@ -38,8 +38,8 @@
<div class="container-fluid">
<a class="brand" href="https://commons.apache.org/proper/commons-csv/">Apache Commons CSV ™</a>
<ul class="nav">
- <li id="publishDate">Last Published: 11 Jan 2025</li>
- <li class="divider">|</li> <li id="projectVersion">Version: 1.13.1-SNAPSHOT</li>
+ <li id="publishDate">Last Published: 15 Mar 2025</li>
+ <li class="divider">|</li> <li id="projectVersion">Version: 1.14.0</li>
</ul>
<div class="pull-right"> <ul class="nav">
<li>
@@ -68,47 +68,52 @@
<ul class="nav nav-list">
<li class="nav-header">Commons CSV</li>
<li class="none">
- <a href="index.html" title="Overview">
- Overview</a>
+ <a href="index.html" title="About">
+ About</a>
</li>
<li class="none">
- <a href="download_csv.cgi" title="Download">
- Download</a>
+ <a href="mail-lists.html" title="Asking Questions">
+ Asking Questions</a>
+ </li>
+ <li class="none">
+ <a href="changes.html" title="Release History">
+ Release History</a>
</li>
- <li class="none active">
- <a href="user-guide.html" title="User Guide">
- User Guide</a>
+ <li class="none">
+ <a href="issue-management.html" title="Issue Tracking">
+ Issue Tracking</a>
+ </li>
+ <li class="none">
+ <a href="dependency-info.html" title="Dependency Management">
+ Dependency Management</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="Javadoc">
Javadoc</a>
</li>
<li class="none">
- <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/latest/index.html" class="externalLink" title="Javadoc Archive">
+ <a href="https://javadoc.io/doc/org.apache.commons/commons-csv/" class="externalLink" title="Javadoc Archive">
Javadoc Archive</a>
</li>
<li class="none">
- <a href="changes.html" title="Release History">
- Release History</a>
+ <a href="scm.html" title="Sources">
+ Sources</a>
</li>
- </ul>
- <ul class="nav nav-list">
- <li class="nav-header">Development</li>
- <li class="none">
- <a href="mail-lists.html" title="Mailing Lists">
- Mailing Lists</a>
+ <li class="none">
+ <a href="security.html" title="Security">
+ Security</a>
</li>
<li class="none">
- <a href="issue-tracking.html" title="Issue Tracking">
- Issue Tracking</a>
+ <a href="https://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License">
+ License</a>
</li>
<li class="none">
- <a href="team.html" title="Team">
- Team</a>
+ <a href="https://www.apache.org/foundation/policies/conduct.html" class="externalLink" title="Code of Conduct">
+ Code of Conduct</a>
</li>
<li class="none">
- <a href="scm.html" title="Source">
- Source</a>
+ <a href="download_bcel.cgi" title="Download">
+ Download</a>
</li>
</ul>
<ul class="nav nav-list">
@@ -232,243 +237,7 @@
<td class="content">
-
-
- <section><a id="Apache_Commons_CSV_User_Guide"></a>
-<h1>Apache Commons CSV User Guide</h1>
-
-
-
-<ul>
-<li><a href="#Apache_Commons_CSV_User_Guide">Apache Commons CSV User Guide</a>
-<ul>
-<li><a href="#Parsing_files">Parsing files</a>
-<ul>
-<li><a href="#Example.3A_Parsing_an_Excel_CSV_File">Example: Parsing an Excel CSV File</a></li>
-<li><a href="#Handling_Byte_Order_Marks">Handling Byte Order Marks</a></li></ul></li>
-<li><a href="#Working_with_headers">Working with headers</a>
-<ul>
-<li><a href="#Accessing_column_values_by_index">Accessing column values by index</a></li>
-<li><a href="#Defining_a_header_manually">Defining a header manually</a></li>
-<li><a href="#Using_an_enum_to_define_a_header">Using an enum to define a header</a></li>
-<li><a href="#Header_auto_detection">Header auto detection</a></li>
-<li><a href="#Printing_with_headers">Printing with headers</a></li></ul></li></ul></li></ul>
-
- <section><a id="Parsing_files"></a>
-<h1>Parsing files</h1>
-
- Parsing files with Apache Commons CSV is relatively straight forward.
- The CSVFormat class provides some commonly used CSV variants:
-
-
-<dl>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#DEFAULT" class="externalLink">DEFAULT</a></dt>
-<dd>Standard Comma Separated Value format, as for RFC4180 but allowing empty lines.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#EXCEL" class="externalLink">EXCEL</a></dt>
-<dd>The Microsoft Excel CSV format.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#INFORMIX_UNLOAD" class="externalLink">INFORMIX_UNLOAD<sup>1.3</sup></a></dt>
-<dd>Informix <a href="http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm" class="externalLink">UNLOAD</a> format used by the <code>UNLOAD TO file_name</code> operation.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#INFORMIX_UNLOAD_CSV" class="externalLink">INFORMIX_UNLOAD_CSV<sup>1.3</sup></a></dt>
-<dd>Informix <a href="http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm" class="externalLink">CSV UNLOAD</a> format used by the <code>UNLOAD TO file_name</code> operation (escaping is disabled.)</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#MYSQL" class="externalLink">MONGO_CSV<sup>1.7</sup></a></dt>
-<dd>MongoDB CSV format used by the <code>mongoexport</code> operation.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#MYSQL" class="externalLink">MONGO_TSV<sup>1.7</sup></a></dt>
-<dd>MongoDB TSV format used by the <code>mongoexport</code> operation.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#MYSQL" class="externalLink">MYSQL</a></dt>
-<dd>The MySQL CSV format.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#ORACLE" class="externalLink">ORACLE<sup>1.6</sup></a></dt>
-<dd>Default Oracle format used by the SQL*Loader utility.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#POSTGRESSQL_CSV" class="externalLink">POSTGRESSQL_CSV<sup>1.5</sup></a></dt>
-<dd>Default PostgreSQL CSV format used by the COPY operation.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#POSTGRESSQL_TEXT" class="externalLink">POSTGRESSQL_TEXT<sup>1.5</sup></a></dt>
-<dd>Default PostgreSQL text format used by the COPY operation.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#RFC4180" class="externalLink">RFC-4180</a></dt>
-<dd>The RFC-4180 format defined by <a href="https://datatracker.ietf.org/doc/html/rfc4180" class="externalLink">RFC-4180</a>.</dd>
-
-<dt><a href="https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#TDF" class="externalLink">TDF</a></dt>
-<dd>A tab delimited format.</dd>
- </dl>
-
- <section><a id="Example.3A_Parsing_an_Excel_CSV_File"></a>
-<h2>Example: Parsing an Excel CSV File</h2>
-
-<p>To parse an Excel CSV file, write:</p>
-
-<pre><code>Reader in = new FileReader("path/to/file.csv");
-Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(in);
-for (CSVRecord record : records) {
- String lastName = record.get("Last Name");
- String firstName = record.get("First Name");
-}
- </code></pre>
- </section>
- <section><a id="Handling_Byte_Order_Marks"></a>
-<h2>Handling Byte Order Marks</h2>
-
-<p>
- To handle files that start with a Byte Order Mark (BOM) like some Excel CSV files, you need an extra step to
- deal with these optional bytes.
- You can use the
- <a href="https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/input/BOMInputStream.html" class="externalLink">
- BOMInputStream
- </a>
- class from
- <a href="https://commons.apache.org/proper/commons-io/" class="externalLink">Apache Commons IO</a>
- for example:
- </p>
-
-<pre><code>
-try (Reader reader = new InputStreamReader(BOMInputStream.builder()
- .setPath(path)
- .get(), "UTF-8");
- CSVParser parser = CSVFormat.EXCEL.builder()
- .setHeader()
- .get()
- .parse(reader)) {
- for (final CSVRecord record : parser) {
- final String string = record.get("ColumnA");
- // ...
- }
-}
- </code></pre>
-
-<p>
- You might find it handy to create something like this:
- </p>
-
-<pre><code>
-/**
- * Creates a reader capable of handling BOMs.
- *
- * @param path The path to read.
- * @return a new InputStreamReader for UTF-8 bytes.
- * @throws IOException if an I/O error occurs.
- */
-public InputStreamReader newReader(final Path path) throws IOException {
- return new InputStreamReader(BOMInputStream.builder()
- .setPath(path)
- .get(), StandardCharsets.UTF_8);
-}
- </code></pre>
- </section>
- </section>
- <section><a id="Working_with_headers"></a>
-<h1>Working with headers</h1>
- Apache Commons CSV provides several ways to access record values.
- The simplest way is to access values by their index in the record.
- However, columns in CSV files often have a name, for example: ID, CustomerNo, Birthday, etc.
- The CSVFormat class provides an API for specifying these <i>header</i> names and CSVRecord on
- the other hand has methods to access values by their corresponding header name.
- <section><a id="Accessing_column_values_by_index"></a>
-<h2>Accessing column values by index</h2>
- To access a record value by index, no special configuration of the CSVFormat is necessary:
-
-<pre><code>Reader in = new FileReader("path/to/file.csv");
-Iterable<CSVRecord> records = CSVFormat.RFC4180.parse(in);
-for (CSVRecord record : records) {
- String columnOne = record.get(0);
- String columnTwo = record.get(1);
-}
- </code></pre>
- </section>
- <section><a id="Defining_a_header_manually"></a>
-<h2>Defining a header manually</h2>
- Indices may not be the most intuitive way to access record values. For this reason it is possible to
- assign names to each column in the file:
-
-<pre><code>Reader in = new FileReader("path/to/file.csv");
-Iterable<CSVRecord> records = CSVFormat.RFC4180.builder()
- .setHeader("ID", "CustomerNo", "Name")
- .build()
- .parse(in);
-for (CSVRecord record : records) {
- String id = record.get("ID");
- String customerNo = record.get("CustomerNo");
- String name = record.get("Name");
-}
- </code></pre>
- Note that column values can still be accessed using their index.
- </section>
- <section><a id="Using_an_enum_to_define_a_header"></a>
-<h2>Using an enum to define a header</h2>
- Using String values all over the code to reference columns can be error prone. For this reason,
- it is possible to define an enum to specify header names. Note that the enum constant names are
- used to access column values. This may lead to enums constant names which do not follow the Java
- coding standard of defining constants in upper case with underscores:
-
-<pre><code>public enum Headers {
- ID, CustomerNo, Name
-}
-Reader in = new FileReader("path/to/file.csv");
-Iterable<CSVRecord> records = CSVFormat.RFC4180.builder()
- .setHeader(Headers.class)
- .build()
- .parse(in);
-for (CSVRecord record : records) {
- String id = record.get(Headers.ID);
- String customerNo = record.get(Headers.CustomerNo);
- String name = record.get(Headers.Name);
-}
- </code></pre>
- Again it is possible to access values by their index and by using a String (for example "CustomerNo").
- </section>
- <section><a id="Header_auto_detection"></a>
-<h2>Header auto detection</h2>
- Some CSV files define header names in their first record. If configured, Apache Commons CSV can parse
- the header names from the first record:
-
-<pre><code>Reader in = new FileReader("path/to/file.csv");
-Iterable<CSVRecord> records = CSVFormat.RFC4180.builder()
- .setHeader()
- .setSkipHeaderRecord(true)
- .build()
- .parse(in);
-for (CSVRecord record : records) {
- String id = record.get("ID");
- String customerNo = record.get("CustomerNo");
- String name = record.get("Name");
-}
- </code></pre>
- This will use the values from the first record as header names and skip the first record when iterating.
- </section>
- <section><a id="Printing_with_headers"></a>
-<h2>Printing with headers</h2>
-
-<p>
- To print a CSV file with headers, you specify the headers in the format:
- </p>
-
-<pre><code>final Appendable out = ...;
-final CSVPrinter printer = CSVFormat.DEFAULT.builder()
- .setHeader("H1", "H2")
- .build()
- .print(out);
- </code></pre>
-
-<p>
- To print a CSV file with JDBC column labels, you specify the ResultSet in the format:
- </p>
-
-<pre><code>try (final ResultSet resultSet = ...) {
- final CSVPrinter printer = CSVFormat.DEFAULT.builder()
- .setHeader(resultSet)
- .build()
- .print(out);
-}
- </code></pre>
- </section>
- </section>
+ <p>The User Guide migrated to the <a href="apidocs/index.html">Javadoc</a>.</p>
</td>
Modified: websites/production/commons/content/proper/commons-csv/xref-test/allclasses-frame.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/xref-test/allclasses-frame.html (original)
+++ websites/production/commons/content/proper/commons-csv/xref-test/allclasses-frame.html Wed Mar 19 22:20:06 2025
@@ -51,8 +51,7 @@
<li><a href="org/apache/commons/csv/perf/PerformanceTest.html#PerformanceTest" target="classFrame">PerformanceTest</a></li>
<li><a href="org/apache/commons/csv/PerformanceTest.html#PerformanceTest.CSVParserFactory" target="classFrame">PerformanceTest.CSVParserFactory</a></li>
<li><a href="org/apache/commons/csv/PerformanceTest.html#PerformanceTest.Stats" target="classFrame">PerformanceTest.Stats</a></li>
- <li><a href="org/apache/commons/csv/TokenMatchers.html#TokenMatchers" target="classFrame">TokenMatchers</a></li>
- <li><a href="org/apache/commons/csv/TokenMatchersTest.html#TokenMatchersTest" target="classFrame">TokenMatchersTest</a></li>
+ <li><a href="org/apache/commons/csv/TokenTest.html#TokenTest" target="classFrame">TokenTest</a></li>
<li><a href="org/apache/commons/csv/UserGuideTest.html#UserGuideTest" target="classFrame">UserGuideTest</a></li>
<li><a href="org/apache/commons/csv/Utils.html#Utils" target="classFrame">Utils</a></li>
</ul>
Modified: websites/production/commons/content/proper/commons-csv/xref-test/index.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/xref-test/index.html (original)
+++ websites/production/commons/content/proper/commons-csv/xref-test/index.html Wed Mar 19 22:20:06 2025
@@ -4,7 +4,7 @@
<!-- this is a JXR report set (jdk8) -->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title>Apache Commons CSV 1.13.1-SNAPSHOT Reference</title>
+ <title>Apache Commons CSV 1.14.0 Reference</title>
<script type="text/javascript">
tmpTargetPage = "" + window.location.search;
if (tmpTargetPage != "" && tmpTargetPage != "undefined")