public final class CSVFile extends Object
CSVParser
and CSVPrinter
.Modifier and Type | Field and Description |
---|---|
static CSVFile |
DEFAULT |
static CSVFile |
EXCEL |
Modifier and Type | Method and Description |
---|---|
static String[] |
header(org.apache.commons.csv.CSVParser parser)
Return header as array.
|
static boolean |
isEmpty(org.apache.commons.csv.CSVRecord record)
Check whether the record is empty.
|
static boolean |
notEmpty(org.apache.commons.csv.CSVRecord record)
Check whether the record is not empty.
|
org.apache.commons.csv.CSVParser |
parse(File in) |
org.apache.commons.csv.CSVParser |
parse(File in,
Charset charset) |
void |
parse(File in,
java.util.function.Consumer<org.apache.commons.csv.CSVParser> task) |
org.apache.commons.csv.CSVParser |
parse(InputStream in) |
org.apache.commons.csv.CSVParser |
parse(InputStream in,
Charset charset) |
org.apache.commons.csv.CSVParser |
parse(Reader in) |
void |
parse(Reader in,
java.util.function.Consumer<org.apache.commons.csv.CSVParser> task) |
static java.util.stream.Stream<org.apache.commons.csv.CSVRecord> |
stream(org.apache.commons.csv.CSVParser parser)
Return a stream of
CSVRecord by filtering out empty records. |
static String[] |
values(org.apache.commons.csv.CSVRecord record)
Return values as array.
|
CSVFile |
withDelimiter(char delimiter) |
CSVFile |
withEscape(char escape) |
CSVFile |
withFirstRecordAsHeader() |
CSVFile |
withHeader(String... header) |
CSVFile |
withQuoteAll() |
org.apache.commons.csv.CSVPrinter |
write(File out) |
org.apache.commons.csv.CSVPrinter |
write(File out,
Charset charset) |
org.apache.commons.csv.CSVPrinter |
write(OutputStream out,
Charset charset) |
org.apache.commons.csv.CSVPrinter |
write(Writer out) |
public CSVFile withDelimiter(char delimiter)
public CSVFile withEscape(char escape)
public CSVFile withQuoteAll()
public CSVFile withFirstRecordAsHeader()
public org.apache.commons.csv.CSVParser parse(InputStream in) throws IOException
IOException
public org.apache.commons.csv.CSVParser parse(InputStream in, Charset charset) throws IOException
IOException
public org.apache.commons.csv.CSVParser parse(Reader in) throws IOException
IOException
public org.apache.commons.csv.CSVParser parse(File in) throws IOException
IOException
public org.apache.commons.csv.CSVParser parse(File in, Charset charset) throws IOException
IOException
public org.apache.commons.csv.CSVPrinter write(Writer out) throws IOException
IOException
public org.apache.commons.csv.CSVPrinter write(OutputStream out, Charset charset) throws IOException
IOException
public org.apache.commons.csv.CSVPrinter write(File out, Charset charset) throws IOException
IOException
public org.apache.commons.csv.CSVPrinter write(File out) throws IOException
IOException
public void parse(File in, java.util.function.Consumer<org.apache.commons.csv.CSVParser> task) throws IOException
IOException
public void parse(Reader in, java.util.function.Consumer<org.apache.commons.csv.CSVParser> task) throws IOException
IOException
public static java.util.stream.Stream<org.apache.commons.csv.CSVRecord> stream(org.apache.commons.csv.CSVParser parser)
CSVRecord
by filtering out empty records.parser
- the CSVParser
CSVRecord
public static String[] header(org.apache.commons.csv.CSVParser parser)
parser
- the CSVParser
public static String[] values(org.apache.commons.csv.CSVRecord record)
record
- the CSVRecord
public static boolean isEmpty(org.apache.commons.csv.CSVRecord record)
record
- the CSVRecord
public static boolean notEmpty(org.apache.commons.csv.CSVRecord record)
record
- the CSVRecord