Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created January 19, 2021 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/8fe0aa068ce23dadc02f3bd0e1802a28 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/8fe0aa068ce23dadc02f3bd0e1802a28 to your computer and use it in GitHub Desktop.
Convert Excel XLSX XLS to CSV or CSV to Excel using Java
// 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);
// 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