Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 51679 invoked from network); 7 Dec 2006 21:50:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 21:50:51 -0000 Received: (qmail 17104 invoked by uid 500); 7 Dec 2006 21:50:57 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 17034 invoked by uid 500); 7 Dec 2006 21:50:57 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 17023 invoked by uid 500); 7 Dec 2006 21:50:57 -0000 Received: (qmail 17020 invoked by uid 99); 7 Dec 2006 21:50:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 13:50:57 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 13:50:48 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 950421A9856; Thu, 7 Dec 2006 13:50:06 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r483683 - /jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java Date: Thu, 07 Dec 2006 21:50:06 -0000 To: commons-cvs@jakarta.apache.org From: yonik@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061207215006.950421A9856@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: yonik Date: Thu Dec 7 13:50:05 2006 New Revision: 483683 URL: http://svn.apache.org/viewvc?view=rev&rev=483683 Log: CSVParser javadoc cleanup (and remove ref to M$ [sic]) Modified: jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java Modified: jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java?view=diff&rev=483683&r1=483682&r2=483683 ============================================================================== --- jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java (original) +++ jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java Thu Dec 7 13:50:05 2006 @@ -16,31 +16,27 @@ */ package org.apache.commons.csv; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; +import java.io.*; import java.util.ArrayList; /** - * Parses cvs files according to the specified configuration. + * Parses CSV files according to the specified configuration. * - * Because CSV appears in many different dialects the parser supports many - * configuration settings. One of the most popular CSV format as supported - * by the M$ corporation (excel-spreadsheets) are supported out-of-the-box - * by the corresponding strategy setter (see {@link #setExcelStrategy()}). + * Because CSV appears in many different dialects, the parser supports many + * configuration settings by allowing the specification of a {@link CSVStrategy}. * - *

Parsing of a csv-string having ';' as separator:

+ *

Parsing of a csv-string having tabs as separators, + * '"' as an optional value encapsulator, and comments starting with '#':

*
  *  String[][] data = 
- *      (new CSVParser(new StringReader("a;b\nc;d"),';')).getAllValues();
+ *   (new CSVParser(new StringReader("a\tb\nc\td"), new CSVStrategy('\t','"','#'))).getAllValues();
  * 
* - *

The API allows chained method calls, if you like this coding style:

+ *

Parsing of a csv-string in Excel CSV format

*
- *  String[][] data = (new CSVParser(new StringReader("a;b\nc;d"),';'))
- *      .setExcelStrategy().setIgnoreEmptyLines(true).getAllValues();
+ *  String[][] data =
+ *   (new CSVParser(new StringReader("a;b\nc;d"), CSVStrategy.EXCEL_STRATEGY)).getAllValues();
  * 
* *

--------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org