public final class CSVWriter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DELIM
Comma delimiter for a .CSV formatted output file.
|
static String |
QUOTE
Quote delimiter for a .CSV formatted output file.
|
Modifier and Type | Method and Description |
---|---|
static List |
arrayCombine(Object... items)
Combines all items as a list.
|
static File |
createFile(String filename)
Creates a CSV file with the specified name.
|
static File |
createNewFile(String filename)
Creates a CSV file with the specified name.
|
static void |
writeData(File csvFile,
List<List> rows)
Writes each row as a set of entries in the .CSV file and
outputs a new line between each row.
|
static void |
writeRow(File csvFile,
List row)
Writes each item in the list as a separate entry in the .CSV file
and outputs a new line in the file.
|
static void |
writeRow(File csvFile,
Object data)
Writes the data as a string row in the .CSV file.
|
public static final String QUOTE
public static final String DELIM
public static File createNewFile(String filename)
filename
- path and name of filepublic static File createFile(String filename)
filename
- path and name of filepublic static void writeData(File csvFile, List<List> rows)
csvFile
- file to write torows
- cells to writepublic static void writeRow(File csvFile, List row)
csvFile
- file to write torow
- entries to writepublic static void writeRow(File csvFile, Object data)
csvFile
- file to write todata
- data to writepublic static List arrayCombine(Object... items)
items
- object elements to combineCopyright © 2015. All rights reserved.