use of org.supercsv.encoder.DefaultCsvEncoder in project openscoring by openscoring.
the class CsvUtil method createFormat.
private static CsvPreference createFormat(char delimiter, char quote) {
CsvPreference.Builder builder = new CsvPreference.Builder(quote, delimiter, "\n");
builder.useEncoder(new DefaultCsvEncoder());
return builder.build();
}
use of org.supercsv.encoder.DefaultCsvEncoder in project hive by apache.
the class SeparatedValuesOutputFormat method getCsvPreference.
private CsvPreference getCsvPreference() {
char separator = this.defaultSeparator;
char quoteChar = DEFAULT_QUOTE_CHAR;
CsvEncoder encoder;
if (DSV_OPT_OUTPUT_FORMAT.equals(beeLine.getOpts().getOutputFormat())) {
separator = beeLine.getOpts().getDelimiterForDSV();
}
if (isQuotingDisabled()) {
quoteChar = '\0';
encoder = new SelectiveCsvEncoder();
} else {
encoder = new DefaultCsvEncoder();
}
return new CsvPreference.Builder(quoteChar, separator, StringUtils.EMPTY).useEncoder(encoder).build();
}
Aggregations