public class CsvImportExportUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CSV_EXPORT_FIELD_DELIMITER |
static java.lang.String |
CSV_EXPORT_FIELD_ESCAPE_MODE |
static java.lang.String |
CSV_EXPORT_FIELD_HEADER |
static java.lang.String |
CSV_EXPORT_FIELD_QUALIFIER |
static java.lang.String |
CSV_EXPORT_FIELD_USE_DESCRIPTIONS |
static java.lang.String |
CSV_EXPORT_FIELD_USE_QUALIFIER |
static TableFormat |
CSV_EXPORT_FORMAT |
static java.lang.String |
CSV_IMPORT_FIELD_COMMENT |
static java.lang.String |
CSV_IMPORT_FIELD_DELIMITER |
static java.lang.String |
CSV_IMPORT_FIELD_ESCAPE_MODE |
static java.lang.String |
CSV_IMPORT_FIELD_HEADER |
static java.lang.String |
CSV_IMPORT_FIELD_QUALIFIER |
static java.lang.String |
CSV_IMPORT_FIELD_USE_QUALIFIER |
static TableFormat |
CSV_IMPORT_FORMAT |
static int |
HEADER_DESCRIPTIONS |
static int |
HEADER_NAMES |
static int |
HEADER_NONE |
static int |
HEADER_SKIP |
static int |
QUALIFIER_FORCE |
static int |
QUALIFIER_NONE |
static int |
QUALIFIER_NORMAL |
| Modifier and Type | Method and Description |
|---|---|
static com.csvreader.CsvReader |
createCsvReader(byte[] data,
char delimiter,
boolean useQualifier,
char qualifier,
int escapeMode,
boolean useComments,
char comment) |
static com.csvreader.CsvReader |
createCsvReader(byte[] data,
DataTable options) |
static boolean |
fillEmptyHeaders(com.csvreader.CsvReader reader)
Replaces all null or empty headers in
reader by the string representation of the corresponding column number. |
static void |
readCsvRecords(DataTable table,
com.csvreader.CsvReader reader,
int header,
boolean hasMoreRecords) |
static TableFormat |
readFormat(DataTable original,
com.csvreader.CsvReader reader,
int header)
Note: in case if
original is null and header is HEADER_NAMES, any null or empty headers in reader will be replaced by the string representation
of the corresponding column number. |
public static final java.lang.String CSV_IMPORT_FIELD_DELIMITER
public static final java.lang.String CSV_IMPORT_FIELD_USE_QUALIFIER
public static final java.lang.String CSV_IMPORT_FIELD_QUALIFIER
public static final java.lang.String CSV_IMPORT_FIELD_COMMENT
public static final java.lang.String CSV_IMPORT_FIELD_ESCAPE_MODE
public static final java.lang.String CSV_IMPORT_FIELD_HEADER
public static final java.lang.String CSV_EXPORT_FIELD_DELIMITER
public static final java.lang.String CSV_EXPORT_FIELD_USE_QUALIFIER
public static final java.lang.String CSV_EXPORT_FIELD_QUALIFIER
public static final java.lang.String CSV_EXPORT_FIELD_ESCAPE_MODE
public static final java.lang.String CSV_EXPORT_FIELD_HEADER
public static final java.lang.String CSV_EXPORT_FIELD_USE_DESCRIPTIONS
public static final int QUALIFIER_NONE
public static final int QUALIFIER_NORMAL
public static final int QUALIFIER_FORCE
public static final int HEADER_NONE
public static final int HEADER_NAMES
public static final int HEADER_DESCRIPTIONS
public static final int HEADER_SKIP
public static TableFormat CSV_EXPORT_FORMAT
public static TableFormat CSV_IMPORT_FORMAT
public static void readCsvRecords(DataTable table, com.csvreader.CsvReader reader, int header, boolean hasMoreRecords) throws AggreGateException, java.io.IOException
AggreGateExceptionjava.io.IOExceptionpublic static com.csvreader.CsvReader createCsvReader(byte[] data,
char delimiter,
boolean useQualifier,
char qualifier,
int escapeMode,
boolean useComments,
char comment)
public static com.csvreader.CsvReader createCsvReader(byte[] data,
DataTable options)
public static TableFormat readFormat(DataTable original, com.csvreader.CsvReader reader, int header) throws java.io.IOException
original is null and header is HEADER_NAMES, any null or empty headers in reader will be replaced by the string representation
of the corresponding column number.java.io.IOExceptionpublic static boolean fillEmptyHeaders(com.csvreader.CsvReader reader)
throws java.io.IOException
reader by the string representation of the corresponding column number.reader - reader has been modifiedjava.io.IOException