POI - Text Extraction

foreword

This article mainly explains that the Excel extraction class is used to quickly read TEXT documents.

Example

public static void main(String[] args) throws Exception
{
  //input stream
  InputStream is = new FileInputStream("f:\\poi\\ffff.xls");
  // file processing system
  POIFSFileSystem fs = new POIFSFileSystem(is);
  //define the workbook
  HSSFWorkbook wb = new HSSFWorkbook(fs);
  
  //excel extractor
  ExcelExtractor excel = new ExcelExtractor(wb);
  //Select whether to display the sheet
  excel.setIncludeSheetNames(false);
  // output text
  System.out.println(excel.getText());
  
}


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324599784&siteId=291194637