fastexcel icon indicating copy to clipboard operation
fastexcel copied to clipboard

Support for reading hyperlinks

Open rusak47 opened this issue 2 years ago • 1 comments

Hello, Right now, I've been searching for an efficient way to read an Excel file and have found this excellent library. However, I can't find a way to extract hyperlinks, so I'm assuming this isn't implemented?

Will it have a big impact on performance if we add support for reading hyperlinks? (which can be disabled by default) As i see from sheet1.xml structure, hyperlinks are referenced in the end of file and url values are stored in sheet1.xml.rels. That means that we can get urls in parallel, but their coordinates only after reading the whole sheet1.xml file.

The real use case is that the government provides the sanction list, where hyperlinks are used to attach supporting documents via urls.

Please, see attached doc

https://www.gov.pl/attachment/a838b74b-6642-422c-b360-8d2638e59f1d

rusak47 avatar Jul 26 '23 14:07 rusak47

If you are interested in this feature, please review my changes and suggest improvements. I'll then make a pull request.

NB: However, it only works when reading all cells at once, for example, in an array. The use of Optional< Row > will significantly complicate matters.

        Optional<Sheet> sheet = excel.getSheet(0);
        Row[] rows = sheet.get().openStream().toArray(Row[]::new);

rusak47 avatar Aug 11 '23 22:08 rusak47