我正在嘗試使用這個
庫,以獲得在Excel文件中的單元格的超鏈接和標籤(該庫是基於Apache POI)在Excel中獲取細胞的超鏈接文件
https://github.com/monitorjbl/excel-streaming-reader#supported-methods
我試着這
InputStream is = new FileInputStream("file");
Workbook workbook = StreamingReader.builder().rowCacheSize(100)
.bufferSize(4096)
.open(is);
Iterator<Row> rowIterator=workbook.getSheetAt(0).iterator();
Row row=rowIterator.next();
Iterator<Cell> cellIterator = row.cellIterator();
Cell currentCell = cellIterator.next();
String parthyperlink=currentCell.getHyperlink().getAddress();
String label=currentCell.getHyperlink().getLabel();
,但我得到這個異常
com.monitorjbl.xlsx.exceptions.NotSupportedException在 com.monitorjbl.xlsx.impl.StreamingCell.getHyperlink(StreamingCell.java:353) 在 com.z2data.mapping.ExeclHorizental.getCurrentRow(ExeclHorizental.java:88)
https://github.com/monitorjbl/excel-streaming-reader/blob/master/src/main/地址java/com/monitorjbl/xlsx/impl/StreamingCell.java#L432 –
爲什麼不使用普通的Apache POI? – Gagravarr
@Gagravarr因爲我有大文件,並根據這個答案http://stackoverflow.com/questions/11891851/how-to-load-a-large-xlsx-file-with-apache-poi我選擇excel-streaming-讀者 – Elsayed