Package jslx.excel
Class ExcelWorkbookAsCSV
- java.lang.Object
-
- jslx.excel.ExcelWorkbookAsCSV
-
public class ExcelWorkbookAsCSV extends java.lang.Object
Helps in converting an Excel workbook to a set of csv file or individual sheets to a csv file
-
-
Constructor Summary
Constructors Constructor Description ExcelWorkbookAsCSV(java.nio.file.Path pathToWorkbook)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsSheet(java.lang.String sheetName)
void
writeXSSFSheetToCSV(java.lang.String sheetName)
CSV file will be in same location as the workbookvoid
writeXSSFSheetToCSV(java.lang.String sheetName, java.nio.file.Path path)
void
writeXSSFWorkbookToCSV(java.nio.file.Path pathToOutPutDirectory)
Writes all sheets of the workbook in the directory, naming each output file the name of each sheet
-
-
-
Method Detail
-
writeXSSFSheetToCSV
public final void writeXSSFSheetToCSV(java.lang.String sheetName) throws java.io.IOException
CSV file will be in same location as the workbook- Parameters:
sheetName
- must not be null and must be in workbook- Throws:
java.io.IOException
- an exception
-
containsSheet
public final boolean containsSheet(java.lang.String sheetName)
- Parameters:
sheetName
- the name to check- Returns:
- true if the workbook contains a Sheet with the provided name
-
writeXSSFSheetToCSV
public final void writeXSSFSheetToCSV(java.lang.String sheetName, java.nio.file.Path path) throws java.io.IOException
- Parameters:
sheetName
- the name of the sheet to write to the filepath
- the path to the file to write to- Throws:
java.io.IOException
- an exception
-
writeXSSFWorkbookToCSV
public final void writeXSSFWorkbookToCSV(java.nio.file.Path pathToOutPutDirectory) throws java.io.IOException
Writes all sheets of the workbook in the directory, naming each output file the name of each sheet- Parameters:
pathToOutPutDirectory
- where to write the files- Throws:
java.io.IOException
- an exception
-
-