java.lang.Object eu.gressly.io.csv.CSVScanner
public class CSVScanner
Split lines from a coma separated values (csv) file. The lines have to be read in advance. This clas does not IO operations. Usually a BufferedInputReader reads the lines and lets them parse by this CSV-Scanner. The separator of entries is a coma (,) but it could be any other character (see second constructor). Values may contain the coma-separator, if only they are qouted ("). To quote quotes, a backslash (\") or a double quote ("") can be used.
Constructor Summary | |
---|---|
CSVScanner(java.lang.String line)
initialize with a single line out of a "csv" file. |
|
CSVScanner(java.lang.String line,
char separator)
Parse a line, which is separated by the given "separator". |
Method Summary | |
---|---|
java.lang.String |
nextToken()
return the next token or "null" for "end of string" |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVScanner(java.lang.String line)
line
- to parse.public CSVScanner(java.lang.String line, char separator)
line
- to parseseparator
- to use instead of the default (,)Method Detail |
---|
public java.lang.String nextToken()