public class CsvReader extends CsvProcessor implements FlatDataStream, Closeable
| Modifier and Type | Field and Description |
|---|---|
static char |
DEFAULT_QUOTE_CHARACTER |
static char |
DEFAULT_SEPARATOR |
| Constructor and Description |
|---|
CsvReader(File file) |
CsvReader(File file,
char separator,
char quoteChar) |
CsvReader(File file,
String charsetName,
char separator,
char quoteChar) |
CsvReader(Reader reader)
Deprecated.
Call
CsvReader(File) instead. |
CsvReader(Reader reader,
char separator,
char quoteChar)
Deprecated.
Call
CsvReader(File, char, char) instead. |
CsvReader(String filename) |
CsvReader(String fileName,
char separator,
char quoteChar) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<String> |
getColumnNames() |
DateFormat |
getDateFormat() |
List<String> |
getFieldNames() |
List<Field> |
getFields() |
long |
getLinesRead() |
boolean |
isHeadersRead() |
FlatRecord |
nextRecord() |
void |
readHeaders() |
CsvLine |
readNextLine() |
void |
setHeadersRead(boolean headersRead) |
int |
size()
Returns the number of lines including the headers
|
setDateFormat, setDateFormat, setFieldNames, setFields, setFieldspublic static final char DEFAULT_SEPARATOR
public static final char DEFAULT_QUOTE_CHARACTER
public CsvReader(String filename) throws FileNotFoundException
FileNotFoundExceptionpublic CsvReader(String fileName, char separator, char quoteChar) throws FileNotFoundException
FileNotFoundExceptionpublic CsvReader(File file) throws FileNotFoundException
FileNotFoundExceptionpublic CsvReader(File file, char separator, char quoteChar) throws FileNotFoundException
FileNotFoundExceptionpublic CsvReader(File file, String charsetName, char separator, char quoteChar) throws FileNotFoundException
FileNotFoundException@Deprecated public CsvReader(Reader reader)
CsvReader(File) instead.@Deprecated public CsvReader(Reader reader, char separator, char quoteChar)
CsvReader(File, char, char) instead.public void readHeaders()
throws IOException
IOExceptionpublic CsvLine readNextLine() throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean isHeadersRead()
public void setHeadersRead(boolean headersRead)
public long getLinesRead()
public List<Field> getFields()
getFields in interface FlatDataStreamgetFields in class CsvProcessorpublic List<String> getFieldNames()
getFieldNames in class CsvProcessorpublic FlatRecord nextRecord() throws IOException
nextRecord in interface FlatDataStreamIOExceptionpublic DateFormat getDateFormat()
getDateFormat in class CsvProcessorpublic int size()
throws IOException
IOExceptionCopyright © 2021 Open Foris. All rights reserved.