public class CSVFileWriter extends CSVFile
| Modifier and Type | Field and Description |
|---|---|
protected PrintWriter |
out
The print writer linked to the CSV file to be written.
|
DEFAULT_FIELD_SEPARATOR, DEFAULT_TEXT_QUALIFIER, fieldSeparator, textQualifier| Constructor and Description |
|---|
CSVFileWriter(String outputFileName)
CSVFileWriter constructor just need the name of the CSV file that will be
written.
|
CSVFileWriter(String outputFileName,
boolean append)
CSVFileWriter constructor just need the name of the CSV file that will be
written.
|
CSVFileWriter(String outputFileName,
char sep)
CSVFileWriter constructor with a given field separator.
|
CSVFileWriter(String outputFileName,
char sep,
boolean append)
CSVFileWriter constructor with a given field separator.
|
CSVFileWriter(String outputFileName,
char sep,
char qual)
CSVFileWriter constructor with given field separator and text qualifier.
|
CSVFileWriter(String outputFileName,
char sep,
char qual,
boolean append)
CSVFileWriter constructor with given field separator and text qualifier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the output CSV file.
|
void |
writeFields(Vector<String> fields)
Join the fields and write them as a new line to the CSV file.
|
getFieldSeparator, getTextQualifier, setFieldSeparator, setTextQualifierprotected PrintWriter out
public CSVFileWriter(String outputFileName) throws IOException
outputFileName - The name of the CSV file to be opened for writingIOException - If an error occurs while creating the filepublic CSVFileWriter(String outputFileName, char sep) throws IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default oneIOException - If an error occurs while creating the filepublic CSVFileWriter(String outputFileName, char sep, char qual) throws IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default onequal - The text qualifier to be used; overwrites the default oneIOException - If an error occurs while creating the filepublic CSVFileWriter(String outputFileName, boolean append) throws IOException
outputFileName - The name of the CSV file to be opened for writingappend - True if rows must be appendedIOException - If an error occurs while creating the filepublic CSVFileWriter(String outputFileName, char sep, boolean append) throws IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default oneappend - True if rows must be appendedIOException - If an error occurs while creating the filepublic CSVFileWriter(String outputFileName, char sep, char qual, boolean append) throws IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default onequal - The text qualifier to be used; overwrites the default oneappend - True if rows must be appendedIOException - If an error occurs while creating the filepublic void close()
throws IOException
IOException - If an error occurs while closing the fileCopyright © 2008-2014 Logical Objects. All Rights Reserved.