public class CSVFileParser extends Object
foo, bar om,,"baz, ,oof",xyz, ->
"foo", " bar om", "", "baz, , oof", "xyz", ""
foo, "bar
bar
bar", baz ->
"foo", "barbarbar", "baz"
Each record (which is usually a line, unless some fields have
a line break in them) is accessed one at a time by calling
nextRecord(). Within each record
recordHasMoreFields() and nextField()
can be used like an Enumeration to iterate through the fields.| Constructor and Description |
|---|
CSVFileParser(BufferedReader reader)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLineNo()
Return the line number.
|
static void |
main(String[] args)
Test harness.
|
String |
nextField() |
boolean |
nextRecord() |
boolean |
recordHasMoreFields()
Are there any more tokens to come?
|
public CSVFileParser(BufferedReader reader)
reader - file readerpublic boolean nextRecord()
throws IOException
IOExceptionpublic int getLineNo()
public boolean recordHasMoreFields()
public String nextField() throws IOException
IOExceptionCopyright © 2000–2021 PanEris. All rights reserved.