TimCoin wrote:
Cell A contains text with a link (Example text), now I would like to have the cell next to it with only the link (specifically just after/including HTTP*). What formula do I need for this?
For example:
Cell A contains: Example text
Then only collect the URL: http://www.apple.com in Cell B.
Hi Tim,
As far as I can tell the link itself is not accessible via formula. And it's not all that easy to access manually either. You have to click the cell, select all the text within it, and then Format > Edit Link (or command-k) :
However I did manage to cobble together an automated way via this Extract Urls from Copied Cells Automator Service (Dropbox download).
To install, just double-click the downloaded .workflow package and, if necessary, click Install Anyway in System Preferences > Security & Privacy.
To use:
- Select the cell(s) with the hyperlinks.
- Command-c to copy to the system clipboard
- Choose Extract Urls from Copied Cells from the Numbers > Services menu.
- Click once in the top destination cell.
- Command-v to paste the urls in the destination column.
So starting with this:
I selected cells A2:A4, typed command-c to copy, ran the service from the Numbers > Service menu, clicked once in B2, and typed command-v. That resulted in this:
Let me know if you have any luck with this. Strictly optional (you can just click and choose from the menu if you don't want to get into any of this) but if you are curious to see how the Service does what it does, you can open it in Automator. To do that, in Finder hold down the option key and navigate Go > Library > Services and double-click it. It will look like this:
It takes what you copied to the clipboard when selecting cells and typing command-c, converts it from "rich text" format to html using textutil (built into every Mac), then uses a built-in Automator action to extract the URLs from the html text, formats that so that Numbers can accept the result, and places the result on the clipboard so that it can be pasted into Numbers wherever you want it using command-v.
SG