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
document| Constructor and Description |
|---|
ExcelExtractor(DirectoryNode dir) |
ExcelExtractor(HSSFWorkbook wb) |
ExcelExtractor(POIFSFileSystem fs) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
_extractHeaderFooter(HeaderFooter hf) |
java.lang.String |
getText()
Retrieves all the text from the document.
|
static void |
main(java.lang.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 true
|
void |
setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included?
Default is true
|
getDocSummaryInformation, getDocument, getMetadataTextExtractor, getRoot, getSummaryInformationclose, setFilesystempublic ExcelExtractor(HSSFWorkbook wb)
public ExcelExtractor(POIFSFileSystem fs) throws java.io.IOException
java.io.IOExceptionpublic ExcelExtractor(DirectoryNode dir) throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException
args - the command line parametersjava.io.IOException - if the file can't be read or contains errorspublic void setIncludeSheetNames(boolean includeSheetNames)
ExcelExtractorsetIncludeSheetNames in interface ExcelExtractorincludeSheetNames - true if the sheet names should be includedpublic void setFormulasNotResults(boolean formulasNotResults)
ExcelExtractorsetFormulasNotResults in interface ExcelExtractorformulasNotResults - true if the formula itself is returnedpublic void setIncludeCellComments(boolean includeCellComments)
ExcelExtractorsetIncludeCellComments in interface ExcelExtractorincludeCellComments - true if cell comments should be includedpublic void setIncludeBlankCells(boolean includeBlankCells)
includeBlankCells - true if blank cells should be includedpublic void setIncludeHeadersFooters(boolean includeHeadersFooters)
ExcelExtractorsetIncludeHeadersFooters in interface ExcelExtractorincludeHeadersFooters - true if headers and footers should be includedpublic java.lang.String getText()
POITextExtractorgetText in interface ExcelExtractorgetText in class POITextExtractorpublic static java.lang.String _extractHeaderFooter(HeaderFooter hf)
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.