Class XLS2CSVmra

  • All Implemented Interfaces:
    HSSFListener

    public class XLS2CSVmra
    extends Object
    implements HSSFListener
    A XLS -> CSV processor, that uses the MissingRecordAware EventModel code to ensure it outputs all columns and rows.
    • Constructor Detail

      • XLS2CSVmra

        public XLS2CSVmra​(POIFSFileSystem fs,
                          PrintStream output,
                          int minColumns)
        Creates a new XLS -> CSV converter
        Parameters:
        fs - The POIFSFileSystem to process
        output - The PrintStream to output the CSV to
        minColumns - The minimum number of columns to output, or -1 for no minimum
      • XLS2CSVmra

        public XLS2CSVmra​(String filename,
                          int minColumns)
                   throws IOException
        Creates a new XLS -> CSV converter
        Parameters:
        filename - The file to process
        minColumns - The minimum number of columns to output, or -1 for no minimum
        Throws:
        IOException - if the file cannot be read or parsing the file fails
    • Method Detail

      • process

        public void process()
                     throws IOException
        Initiates the processing of the XLS file to CSV
        Throws:
        IOException - if the workbook contained errors
      • processRecord

        public void processRecord​(Record record)
        Main HSSFListener method, processes events, and outputs the CSV as the file is processed.
        Specified by:
        processRecord in interface HSSFListener