如何在使用OpenCSV5.3写入csv文件时跳过引用?

gev0vcfq  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(216)

我正在尝试在csv文件上写入,如下函数所示:

private void writeDataToCSVDestinationFile(Path csvPath, Path destPath, String colToNormalize) throws IOException, CsvException {
    CSVWriter writer = new CSVWriter(new FileWriter(destPath.toString()));
        CSVReader reader = new CSVReader(new FileReader(csvPath.toString()));

        String [] headerDes = new String [header.length+1];  
        for (int i=0; i<header.length; i++){
        headerDes[i]= header[i];
        }
        headerDes[header.length]= colToNormalize+"_z";
        writer.writeNext(headerDes);
        writer.close();

}
但我失败了:

expected: <id,name,mark,mark_z> but was: <"id","name","mark","mark_z">

我怎样才能以这种格式制作并跳过报价?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题