-
Notifications
You must be signed in to change notification settings - Fork 1k
Parse and show URLs for hyperlink cells in XLSX #717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Parse and show URLs for hyperlink cells in XLSX #717
Conversation
|
Hey. I'm the author or excel-mapper, a library built on We support mapping For example we've seen examples of values that have the text value Would be great to have this reviewed |
|
@hughbe can you please share a sample xlsx file? I can take a look. Thanks! |
|
I haven't had time to properly go through this. Sorry. But can't we have a proper object (or struct) with the hyperlink info instead of object that you get from GetHyperlink if there is one or null if there isn't or parsing urls is not enabled in the configuration? And unless there's a huge performance impact, can't parsing hyperlink information be done always? And what about .xls support? |
|
Here's an anonymised example: Urls_Example.xlsx User is ingested a table where the ID is linked. Wants to read the URI
|

This is a solution for issue: #663 (XLSX link cell type)
For cells with hyperlink in xlsx files, the reader will parse both display text and URL.
Parsing hyperlinks with AsDataSet():
Hyperlink cells can be read as either display text, URL, or both.
When using
HyperlinkParsingOption.Tuple, each hyperlink cell is returned as aTuple<object, object>containing(DisplayText, URL).You can then transform the tuple into whichever representation you need.
Example code:
Example Output:
For a cell containing a hyperlink with display text "Click here" and URL "https://example.com":
HyperlinkParsingOptionDisplayText"Click here"URL"https://example.com"Tuple("Click here", "https://example.com")Note:
✅ Only External (Absolute) Hyperlinks parsing are supported. (i.e.--
http://example.com,mailto:user@example.com,file:///C:/docs/file.pdf.)❌ Internal Document Links are not supported. (i.e. --
#Sheet2!A1,#MyNamedRange)Screenshot:
Left: The xlsx file | Right: The parsed dataset view
