org.deegree.commons.dataaccess
Class CSVReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
java.io.LineNumberReader
org.deegree.commons.dataaccess.CSVReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class CSVReader
- extends java.io.LineNumberReader
The CSVReader
reads a csv file line by line. Note the regular expression for quotes may not work under
all circumstances, a Tokenizer might be a better solution.
- Version:
- $Revision: 18171 $, $Date: 2009-06-17 16:00:07 +0200 (Mi, 17. Jun 2009) $
- Author:
- Rutger Bezema, last edited by: $Author: mschneider $
Fields inherited from class java.io.Reader |
lock |
Constructor Summary |
CSVReader(java.io.Reader in,
java.lang.String delimiter,
boolean firstLineContainsColumnNames)
|
Methods inherited from class java.io.LineNumberReader |
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip |
Methods inherited from class java.io.BufferedReader |
close, markSupported, ready |
Methods inherited from class java.io.Reader |
read, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVReader
public CSVReader(java.io.Reader in,
java.lang.String delimiter,
boolean firstLineContainsColumnNames)
- Parameters:
in
- delimiter
- firstLineContainsColumnNames
-
parseLine
public java.lang.String[] parseLine()
throws java.io.IOException
- Returns:
- the values of the
- Throws:
java.io.IOException
getColumnsNames
public final java.lang.String[] getColumnsNames()
- Returns:
- the values of the first row, which may be the column names or the first line of data.
getNumberOfColumns
public final int getNumberOfColumns()
- Returns:
- the numberOfColumns
getDelimiter
public final java.lang.String getDelimiter()
- Returns:
- the delimiter
Copyright © 2011. All Rights Reserved.