Package org.apache.poi

Examples of org.apache.poi.POITextExtractor


      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here


          new FileInputStream(simpleXLS)));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      //System.out.println(text.length());
      //System.out.println(text);
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
View Full Code Here

         System.out.println(DIVIDER);
        
         File f = new File(args[i]);
         System.out.println(f);
        
         POITextExtractor extractor =
            ExtractorFactory.createExtractor(f);
         POITextExtractor metadataExtractor =
            extractor.getMetadataTextExtractor();
        
         System.out.println("   " + DIVIDER);
         System.out.println(metadataExtractor.getText());
         System.out.println("   " + DIVIDER);
         System.out.println(extractor.getText());
         System.out.println(DIVIDER);
      }
   }
View Full Code Here

      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here

      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here

      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here

      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      @SuppressWarnings("resource")
            POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here

      new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
   
    POITextExtractor[] extractors =
      new POITextExtractor[] { ooxmlExtractor, ole2Extractor };
    for (int i = 0; i < extractors.length; i++) {
      @SuppressWarnings("resource")
            POITextExtractor extractor = extractors[i];
     
      String text = extractor.getText().replaceAll("[\r\t]", "");
      assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
      Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
      Matcher m = pattern.matcher(text);
      assertTrue(m.matches());     
    }
View Full Code Here

        try
        {

            String extractedText = null;
            new ExtractorFactory();
            POITextExtractor pptExtractor = ExtractorFactory
                    .createExtractor(source);

            // PowerPoint XML files and legacy format PowerPoint files
            // require different classes and APIs for text extraction
View Full Code Here

TOP

Related Classes of org.apache.poi.POITextExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.