public class CSVWriter extends Object
| Constructor and Description |
|---|
CSVWriter(Writer pw)
convenience Constructor, defaults to quotelevel 1, comma separator , trim
|
CSVWriter(Writer pw,
int quoteLevel,
char separator,
char quote,
boolean trim)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the PrintWriter.
|
static void |
main(String[] args)
Test driver
|
void |
nl()
Write a new line in the CVS output file to demark the end of record.
|
void |
print(Object... values) |
void |
println(Object... values) |
void |
put(String... values)
Write one csv field to the file, followed by a separator unless it is the
last field on the line.
|
void |
setDefaultNullValue(String in)
Set default value if put() gets a value of null.
|
public CSVWriter(Writer pw)
pw - Writer where fields will be written.public CSVWriter(Writer pw, int quoteLevel, char separator, char quote, boolean trim)
pw - Writer where fields will be written.quoteLevel - 0 = minimal quotes separator - field separator character, usually ',' in North America, ';'
in Europe and sometimes '\t' for tab.quote - char to use to enclose fields containing a separator, usually
'\"'trim - true if writer should trim leading/trailing whitespace (e.g.
blank, cr, Lf, tab) before writing the field.public void close()
public void setDefaultNullValue(String in)
in - public void nl()
public void print(Object... values)
public void println(Object... values)
public void put(String... values)
s - The string to write. Any additional quotes or embedded quotes
will be provided by put. Null means start a new line.public static void main(String[] args)
args - not usedCopyright © 2014. All rights reserved.