Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SKIP_LINES
The default line to start reading.
|
Constructor and Description |
---|
CSVReader(Reader reader)
Constructs CSVReader using a comma for the separator.
|
CSVReader(Reader reader,
char separator)
Constructs CSVReader with supplied separator.
|
CSVReader(Reader reader,
char separator,
char quotechar)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(Reader reader,
char separator,
char quotechar,
boolean strictQuotes)
Constructs CSVReader with supplied separator, quote char and quote
handling behavior.
|
CSVReader(Reader reader,
char separator,
char quotechar,
char escape)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(Reader reader,
char separator,
char quotechar,
char escape,
int line)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes,
boolean ignoreLeadingWhiteSpace)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(Reader reader,
char separator,
char quotechar,
int line)
Constructs CSVReader with supplied separator and quote char.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying reader.
|
boolean |
hasNext() |
String[] |
next() |
List<String[]> |
readAll()
Reads the entire file into a List with each element being a String[] of
tokens.
|
String[] |
readNext()
Reads the next line from the buffer and converts to a string array.
|
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public static final int DEFAULT_SKIP_LINES
public CSVReader(Reader reader)
reader
- the reader to an underlying CSV source.public CSVReader(Reader reader, char separator)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entries.public CSVReader(Reader reader, char separator, char quotechar)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementspublic CSVReader(Reader reader, char separator, char quotechar, boolean strictQuotes)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsstrictQuotes
- sets if characters outside the quotes are ignoredpublic CSVReader(Reader reader, char separator, char quotechar, char escape)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsescape
- the character to use for escaping a separator or quotepublic CSVReader(Reader reader, char separator, char quotechar, int line)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsline
- the line number to skip for start readingpublic CSVReader(Reader reader, char separator, char quotechar, char escape, int line)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsescape
- the character to use for escaping a separator or quoteline
- the line number to skip for start readingpublic CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsescape
- the character to use for escaping a separator or quoteline
- the line number to skip for start readingstrictQuotes
- sets if characters outside the quotes are ignoredpublic CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes, boolean ignoreLeadingWhiteSpace)
reader
- the reader to an underlying CSV source.separator
- the delimiter to use for separating entriesquotechar
- the character to use for quoted elementsescape
- the character to use for escaping a separator or quoteline
- the line number to skip for start readingstrictQuotes
- sets if characters outside the quotes are ignoredignoreLeadingWhiteSpace
- it true, parser should ignore white space
before a quote in a fieldpublic List<String[]> readAll() throws IOException
IOException
- if bad things happen during the readpublic String[] readNext() throws IOException
IOException
- if bad things happen during the readpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if the close failsCopyright © 2019. All rights reserved.