-
Notifications
You must be signed in to change notification settings - Fork 4
7 Exporting data to a CSV file
Dan Geabunea edited this page Apr 2, 2015
·
2 revisions
There are times when we also want to write data to CSV. Luckily, the EasyCsv library can help with this task as well. Each CsvDocument object can be exported to a file. You can use 2 approaches:
CsvDocument document = ...
String csvContent = document.toString();
//manually save a file with the csvContent
...
CsvDocument document = ...
String outputPath "\home\user\downloads";
boolean saveResult = CsvDocument.tryWriteToFile(document , outputPath);
if(saveResult){
//save successful
}
else{
//save not successful
}
...