Class XLS2CSVmra
- java.lang.Object
-
- org.apache.poi.examples.hssf.eventusermodel.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 Summary
Constructors Constructor Description XLS2CSVmra(String filename, int minColumns)Creates a new XLS -> CSV converterXLS2CSVmra(POIFSFileSystem fs, PrintStream output, int minColumns)Creates a new XLS -> CSV converter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)voidprocess()Initiates the processing of the XLS file to CSVvoidprocessRecord(Record record)Main HSSFListener method, processes events, and outputs the CSV as the file is processed.
-
-
-
Constructor Detail
-
XLS2CSVmra
public XLS2CSVmra(POIFSFileSystem fs, PrintStream output, int minColumns)
Creates a new XLS -> CSV converter- Parameters:
fs- The POIFSFileSystem to processoutput- The PrintStream to output the CSV tominColumns- 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 processminColumns- 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 IOExceptionInitiates 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:
processRecordin interfaceHSSFListener
-
-