|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.io.CSVReader
public class CSVReader
Reads values from a comma separated (CSV) stream.
EBNF rules for the CSV format:
CSV = Record {RecordSeparator, Record}
Record = Field {FieldSeparator, Field}
RecordSeparator = linebreak
Field = UnquotedField | DQuotedField
FieldSeparator = {whitespace} comma {whitespace}
UnquotedField = (simplechar) {{simplechar|space}, (simplechar)}
DQuotedField = dquote (simplechar|stuffeddquote|linebreak|comma} dquote
simplechar = (* every character except specialchar *)
specialchar = linebreak | comma | dquote | whitespace
linebreak = lf | cr | cr, lf
comma = ','
dquote = '"'
stuffeddquote = '""'
lf = 0x0a
cr = 0x0d
whitespace = space | tab
space = ' '
tab = 0x07
Simple Example with unquoted fields:
Jacques, Mayol, Rue St. Claire 8, Antibes Enzo, Maiorca, Via Roma 2, TaorminaExample with quoted fields:
Trio, "Uno, due, tre!", Pop Alice, "Did you go? Did you stay?", Rock The Pringles, "He said ""I like it""", Pop
| Constructor Summary | |
|---|---|
CSVReader(java.io.Reader in,
char delimiterChar,
char quoteChar)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
java.lang.String[] |
readln()
Returns null, if EOF has been reached. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVReader(java.io.Reader in,
char delimiterChar,
char quoteChar)
| Method Detail |
|---|
public java.lang.String[] readln()
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||