public class ExcelExtractor extends POIOLE2TextExtractor implements ExcelExtractor
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.javadocument
Constructor and Description |
---|
ExcelExtractor(DirectoryNode dir) |
ExcelExtractor(DirectoryNode dir,
POIFSFileSystem fs)
Deprecated.
Use
ExcelExtractor(DirectoryNode) instead |
ExcelExtractor(HSSFWorkbook wb) |
ExcelExtractor(POIFSFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
static String |
_extractHeaderFooter(HeaderFooter hf) |
String |
getText()
Retrieves the text contents of the file
|
static void |
main(String[] args)
Command line extractor.
|
void |
setFormulasNotResults(boolean formulasNotResults)
Should we return the formula itself, and not
the result it produces? Default is false
|
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.
|
void |
setIncludeCellComments(boolean includeCellComments)
Should cell comments be included? Default is false
|
void |
setIncludeHeadersFooters(boolean includeHeadersFooters)
Should headers and footers be included in the output?
Default is to include them.
|
void |
setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included? Default is true
|
getDocSummaryInformation, getFileSystem, getMetadataTextExtractor, getRoot, getSummaryInformation
public ExcelExtractor(HSSFWorkbook wb)
public ExcelExtractor(POIFSFileSystem fs) throws IOException
IOException
@Deprecated public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException
ExcelExtractor(DirectoryNode)
insteadIOException
public ExcelExtractor(DirectoryNode dir) throws IOException
IOException
public static void main(String[] args)
public void setIncludeSheetNames(boolean includeSheetNames)
setIncludeSheetNames
in interface ExcelExtractor
public void setFormulasNotResults(boolean formulasNotResults)
setFormulasNotResults
in interface ExcelExtractor
public void setIncludeCellComments(boolean includeCellComments)
setIncludeCellComments
in interface ExcelExtractor
public void setIncludeBlankCells(boolean includeBlankCells)
public void setIncludeHeadersFooters(boolean includeHeadersFooters)
public String getText()
getText
in interface ExcelExtractor
getText
in class POITextExtractor
public static String _extractHeaderFooter(HeaderFooter hf)
Copyright © 2020. All rights reserved.