Java - Writing strings to a CSV file

前端 未结 7 2278
野趣味
野趣味 2020-11-28 10:45

I am trying to write data to a csv file with java, however when I try opening the produced file with excel I am getting an error saying the file is corrupt. Upon opening the

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 11:23

    I see you already have a answer but here is another answer, maybe even faster A simple class to pass in a List of objects and retrieve either a csv or excel or password protected zip csv or excel. https://github.com/ernst223/spread-sheet-exporter

    SpreadSheetExporter spreadSheetExporter = new SpreadSheetExporter(List, "Filename");
    File fileCSV = spreadSheetExporter.getCSV();
    
        

    提交回复
    热议问题