Last active
September 10, 2020 22:12
-
-
Save farhan-raza/040146432340e171e55953a1795a563a to your computer and use it in GitHub Desktop.
Excel XLSX XLS to CSV or CSV to Excel using 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
// Opening CSV Files | |
// Creating CSV LoadOptions object | |
LoadOptions loadOptions = new LoadOptions(FileFormatType.CSV); | |
// Creating an Workbook object with CSV file path and the loadOptions | |
// object | |
Workbook workbook = new Workbook(dataDir + "Book_CSV.csv", loadOptions); | |
workbook.save(dataDir + "CSVtoExcel.xlsx" , SaveFormat.XLSX); |
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
// Load the input Excel file | |
Workbook workbook = new Workbook(dataDir + "CSVtoExcel.xlsx"); | |
// Save output CSV file | |
workbook.save(dataDir + "ExcelToCSV.csv" , SaveFormat.CSV); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment