ASF Bugzilla – Attachment 23163 Details for
Bug 46544
[PATCH] Add main() method to org.apache.poi.hssf.extractor.ExcelExtractor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to add main() method to java org.apache.poi.hssf.extractor.ExcelExtractor
ExcelExtractor-main.patch (text/plain), 1.32 KB, created by
Georger Araujo
on 2009-01-22 16:19:52 UTC
(
hide
)
Description:
Patch to add main() method to java org.apache.poi.hssf.extractor.ExcelExtractor
Filename:
MIME Type:
Creator:
Georger Araujo
Created:
2009-01-22 16:19:52 UTC
Size:
1.32 KB
patch
obsolete
>--- ExcelExtractor.java.orig 2008-09-23 17:35:31 +0000 >+++ ExcelExtractor.java 2009-01-22 23:59:00 +0000 >@@ -18,6 +18,8 @@ > package org.apache.poi.hssf.extractor; > > import java.io.IOException; >+import java.io.InputStream; >+import java.io.FileInputStream; > > import org.apache.poi.POIOLE2TextExtractor; > import org.apache.poi.ss.usermodel.HeaderFooter; >@@ -51,13 +53,35 @@ > super(wb); > this.wb = wb; > } >+ >+ public ExcelExtractor(String fileName) throws IOException { >+ this(new FileInputStream(fileName)); >+ } >+ >+ public ExcelExtractor(InputStream iStream) throws IOException { >+ this(new POIFSFileSystem(iStream)); >+ } >+ > public ExcelExtractor(POIFSFileSystem fs) throws IOException { > this(fs.getRoot(), fs); > } > public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException { > this(new HSSFWorkbook(dir, fs, true)); > } >- >+ >+ /** >+ * Command line extractor. >+ */ >+ public static void main(String[] args) throws Exception { >+ if(args.length < 1) { >+ System.err.println("Use:"); >+ System.err.println(" java org.apache.poi.hssf.extractor.ExcelExtractor <filename.xls>"); >+ System.exit(1); >+ } >+ >+ ExcelExtractor extractor = new ExcelExtractor(args[0]); >+ System.out.println(extractor.getText()); >+ } > > /** > * Should sheet names be included? Default is true
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46544
:
23163
|
23170