本文整理匯總了Java中au.com.bytecode.opencsv.CSVWriter.DEFAULT_QUOTE_CHARACTER屬性的典型用法代碼示例。如果您正苦於以下問題:Java CSVWriter.DEFAULT_QUOTE_CHARACTER屬性的具體用法?Java CSVWriter.DEFAULT_QUOTE_CHARACTER怎麽用?Java CSVWriter.DEFAULT_QUOTE_CHARACTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類au.com.bytecode.opencsv.CSVWriter
的用法示例。
在下文中一共展示了CSVWriter.DEFAULT_QUOTE_CHARACTER屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: HITDataCSVReader
public HITDataCSVReader(String fileName, char separator) throws IOException {
super();
InputStreamReader input = new InputStreamReader(new FileInputStream(fileName), "UTF-8");
CSVReader csvReader = new CSVReader(input, separator, CSVWriter.DEFAULT_QUOTE_CHARACTER);
String[] row = null;
try {
// read all lines but skip header rows that got appended repetitively
while ((row = csvReader.readNext()) != null) {
if (fieldNames == null) {
fieldNames = row;
rows.add(fieldNames); // header is at index 0
}
else if (!Arrays.equals(fieldNames, row)) {
rows.add(row);
}
}
}
finally {
csvReader.close();
}
}
示例2: getWriter
protected synchronized CSVWriter getWriter() throws IOException {
if (this.csvWriter == null) {
FileOutputStream fos = new FileOutputStream(this.fileName, appendToFile); // always append,
OutputStreamWriter writer = new OutputStreamWriter(fos, "UTF-8");
this.csvWriter = new CSVWriter( writer,
separator,
useQuotes ? CSVWriter.DEFAULT_QUOTE_CHARACTER : CSVWriter.NO_QUOTE_CHARACTER,
System.getProperty("line.separator"));
}
return this.csvWriter;
}