For details, you can visit the full article that explains Conversion of CSV and XLS, XLSX formats in Java.
Last active
August 3, 2021 04:22
-
-
Save GroupDocsGists/f76d26570da3a1c3781cde92da456683 to your computer and use it in GitHub Desktop.
Convert Excel Spreadsheets to CSV and CSV to XLS/XLSX in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert CSV files to XLS/XLSX format in Java | |
CsvLoadOptions loadOptions = new CsvLoadOptions(); | |
loadOptions.setSeparator(','); | |
Converter converter = new Converter("path/comma-sparated-values.csv", loadOptions); | |
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions(); | |
options.setFormat(SpreadsheetFileType.Xlsx); | |
converter.convert("path/spreadsheet.xlsx", options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert Excel Spreadsheets to Comma Separated Values CSV format in Java | |
Converter converter = new Converter("path/spreadsheet.xlsx"); | |
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions(); | |
options.setFormat(SpreadsheetFileType.Csv); // Specify the conversion format | |
converter.convert("path/convertedfile.csv", options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment