Example usage for org.apache.poi.hssf.extractor OldExcelExtractor getText

List of usage examples for org.apache.poi.hssf.extractor OldExcelExtractor getText

Introduction

In this page you can find the example usage for org.apache.poi.hssf.extractor OldExcelExtractor getText.

Prototype

public String getText() 

Source Link

Document

Retrieves the text contents of the file, as best we can for these old file formats

Usage

From source file:org.apache.tika.parser.microsoft.OldExcelParser.java

License:Apache License

protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml)
        throws TikaException, IOException, SAXException {
    // Get the whole text, as a single string
    String text = extractor.getText();

    // Split and output
    xhtml.startDocument();/*from ww w  .  ja  v a 2  s. c  o m*/

    String line;
    BufferedReader reader = new BufferedReader(new StringReader(text));
    while ((line = reader.readLine()) != null) {
        xhtml.startElement("p");
        xhtml.characters(line);
        xhtml.endElement("p");
    }

    xhtml.endDocument();
}