@Grab(group='org.apache.poi', module='poi', version='3.9') import org.apache.poi.hpsf.* import org.apache.poi.poifs.eventfilesystem.* reader = new POIFSReader() reader.registerListener(new POIFSReaderListener(){ public void processPOIFSReaderEvent(POIFSReaderEvent event) { SummaryInformation si = null try { si = PropertySetFactory.create(event.getStream()); } catch(Exception ex) { throw new RuntimeException(ex) } println "タイトル:${si.getTitle()}" println "作成者:${si.getAuthor()}" println "表題:${si.getSubject()}" println "キーワード:${si.getKeywords()}" println "コメント:${si.getComments()}" } }, "\005SummaryInformation"); reader.read(new FileInputStream("test.xls"))動作環境
groovy 2.1.7, JDK7 update40
0 件のコメント:
コメントを投稿