org.apache.poi.hssf.extractor
Class ExcelExtractor
- java.lang.Object
-
- org.apache.poi.POITextExtractor
-
- org.apache.poi.POIOLE2TextExtractor
-
- org.apache.poi.hssf.extractor.ExcelExtractor
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable, ExcelExtractor
public class ExcelExtractor extends POIOLE2TextExtractor implements ExcelExtractor
A text extractor for Excel files.Returns the textual content of the file, suitable for indexing by something like Lucene, but not really intended for display to the user.
To turn an excel file into a CSV or similar, then see the XLS2CSVmra example
http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java
-
-
Constructor Summary
Constructors Constructor and Description ExcelExtractor(DirectoryNode dir)ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs)Deprecated.UseExcelExtractor(DirectoryNode)insteadExcelExtractor(HSSFWorkbook wb)ExcelExtractor(POIFSFileSystem fs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.String_extractHeaderFooter(HeaderFooter hf)java.lang.StringgetText()Retrieves the text contents of the filestatic voidmain(java.lang.String[] args)Command line extractor.voidsetFormulasNotResults(boolean formulasNotResults)Should we return the formula itself, and not the result it produces? Default is falsevoidsetIncludeBlankCells(boolean includeBlankCells)Should blank cells be output? Default is to only output cells that are present in the file and are non-blank.voidsetIncludeCellComments(boolean includeCellComments)Should cell comments be included? Default is falsevoidsetIncludeHeadersFooters(boolean includeHeadersFooters)Should headers and footers be included in the output? Default is to include them.voidsetIncludeSheetNames(boolean includeSheetNames)Should sheet names be included? Default is true-
Methods inherited from class org.apache.poi.POIOLE2TextExtractor
getDocSummaryInformation, getFileSystem, getMetadataTextExtractor, getRoot, getSummaryInformation
-
Methods inherited from class org.apache.poi.POITextExtractor
close
-
-
-
-
Constructor Detail
-
ExcelExtractor
public ExcelExtractor(HSSFWorkbook wb)
-
ExcelExtractor
public ExcelExtractor(POIFSFileSystem fs) throws java.io.IOException
- Throws:
java.io.IOException
-
ExcelExtractor
@Deprecated public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws java.io.IOException
Deprecated. UseExcelExtractor(DirectoryNode)instead- Throws:
java.io.IOException
-
ExcelExtractor
public ExcelExtractor(DirectoryNode dir) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
Command line extractor.
-
setIncludeSheetNames
public void setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included? Default is true- Specified by:
setIncludeSheetNamesin interfaceExcelExtractor
-
setFormulasNotResults
public void setFormulasNotResults(boolean formulasNotResults)
Should we return the formula itself, and not the result it produces? Default is false- Specified by:
setFormulasNotResultsin interfaceExcelExtractor
-
setIncludeCellComments
public void setIncludeCellComments(boolean includeCellComments)
Should cell comments be included? Default is false- Specified by:
setIncludeCellCommentsin interfaceExcelExtractor
-
setIncludeBlankCells
public void setIncludeBlankCells(boolean includeBlankCells)
Should blank cells be output? Default is to only output cells that are present in the file and are non-blank.
-
setIncludeHeadersFooters
public void setIncludeHeadersFooters(boolean includeHeadersFooters)
Should headers and footers be included in the output? Default is to include them.- Specified by:
setIncludeHeadersFootersin interfaceExcelExtractor
-
getText
public java.lang.String getText()
Retrieves the text contents of the file- Specified by:
getTextin interfaceExcelExtractor- Specified by:
getTextin classPOITextExtractor- Returns:
- All the text from the document
-
_extractHeaderFooter
public static java.lang.String _extractHeaderFooter(HeaderFooter hf)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG