Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save groupdocs-com-kb/758e94fe655d0341c6557bf51f375541 to your computer and use it in GitHub Desktop.
Save groupdocs-com-kb/758e94fe655d0341c6557bf51f375541 to your computer and use it in GitHub Desktop.
How to Convert Excel to CSV in Java. For more information, please follow link: https://kb.groupdocs.com/conversion/java/how-to-convert-excel-to-csv-in-java/
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.licensing.License;
import com.groupdocs.conversion.options.convert.SpreadsheetConvertOptions;
import com.groupdocs.conversion.filetypes.SpreadsheetFileType;
public class ConvertExcelToCsvInJava {
public static void main(String[] args) { // Main function to convert Excel to CSV in Java
// Remove the watermark in output Text document by adding license
License lic = new License();
lic.setLicense("GroupDocs.Conversion.lic");
// Load the source Excel file for conversion to CSV
Converter converter = new Converter("sample.xlsx");
// Set the convert options for CSV file
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
options.setFormat(SpreadsheetFileType.Csv); // Specify the conversion format
// Convert and save the Excel in CSV format
converter.convert("converted.csv", options);
System.out.println("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment