org.apache.poi.hssf.eventusermodel.examples
Class XLS2CSVmra

java.lang.Object
  extended by org.apache.poi.hssf.eventusermodel.examples.XLS2CSVmra
All Implemented Interfaces:
HSSFListener

public class XLS2CSVmra
extends java.lang.Object
implements HSSFListener

A XLS -> CSV processor, that uses the MissingRecordAware EventModel code to ensure it outputs all columns and rows.

Author:
Nick Burch

Constructor Summary
XLS2CSVmra(POIFSFileSystem fs, java.io.PrintStream output, int minColumns)
          Creates a new XLS -> CSV converter
XLS2CSVmra(java.lang.String filename, int minColumns)
          Creates a new XLS -> CSV converter
 
Method Summary
static void main(java.lang.String[] args)
           
 void process()
          Initiates the processing of the XLS file to CSV
 void processRecord(Record record)
          Main HSSFListener method, processes events, and outputs the CSV as the file is processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XLS2CSVmra

public XLS2CSVmra(POIFSFileSystem fs,
                  java.io.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(java.lang.String filename,
                  int minColumns)
           throws java.io.IOException,
                  java.io.FileNotFoundException
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:
java.io.IOException
java.io.FileNotFoundException
Method Detail

process

public void process()
             throws java.io.IOException
Initiates the processing of the XLS file to CSV

Throws:
java.io.IOException

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

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.