Package jslx.excel

Class 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 workbook
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExcelWorkbookAsCSV

        public ExcelWorkbookAsCSV​(java.nio.file.Path pathToWorkbook)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • 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 file
        path - 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