|
-bottom | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.csv4j.CSVParser
public class CSVParser
Parses CSV lines of text. Options are available to choose the
Notes: Line with trailing comma will result in an empty string field
Attempts to follow this suggestion from RFC4180:
Implementors should
"be conservative in what you do, be liberal in what you accept from others" (RFC 793)
when processing CSV files.
Constructor Summary | |
---|---|
CSVParser()
Constructor with default delimiter (,) and trimFields (true). |
|
CSVParser(char delimiter,
boolean trimFields)
Constructs the parser with specified options |
Method Summary | |
---|---|
List<String> |
tokenize(String line)
Assumes this is one line of CSV text |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVParser()
public CSVParser(char delimiter, boolean trimFields)
delimiter
- field separator character (e.g. comma, tab, vertical bar / pipe, space)trimFields
- indicates if fields are to be trimmed or notMethod Detail |
---|
public List<String> tokenize(String line) throws ParseException
line
- line of text to parse
ParseException
- if
|
-bottom | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |