Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to encode a hyperlink in CSV formatted file?

When I try to encode a HTML anchor link in CSV file cell it becomes corrupted and not readable by Excel.

Is there some sort of non-HTML solution or format to encode a hyperlink in CSV file cell?

like image 808
gep Avatar asked Sep 27 '11 16:09

gep


People also ask

Can CSV have hyperlink?

Actual Results: CSV contains Excel formulas for attributes that use links, such as '=HYPERLINK("http://xxx/niku/nu#action:projmgr.projectProperties&id=5047176","4G Upgrade Readiness")'. Clicking in the cell may also generate a message to indicate 'Text values in formulas are limited to 255 characters'.

How do I remove a hyperlink from a CSV file?

Select the entire column with Hyperlinks: click on any cell with data and press Ctrl+Space. Right-click on any selected cell and select "Remove hyperlinks" from the context menu.

How do I create a hyperlink in Excel?

On a worksheet, select the cell where you want to create a link. On the Insert tab, select Hyperlink. You can also right-click the cell and then select Hyperlink... on the shortcut menu, or you can press Ctrl+K. Under Display Text:, type the text that you want to use to represent the link.


2 Answers

For when automagicalism doesn't work, and you're definitely using Excel, use this as the field content.

=HYPERLINK("http://stackoverflow.com") 
like image 178
stuartdotnet Avatar answered Sep 18 '22 11:09

stuartdotnet


This worked for me:

  1. Use the =HYPERLINK function, the first parameter is the web link, the second is the cell value.
  2. Put " quotes around the entire function.
  3. Escape the internal quotes within the function with two sets of quotes, i.e., ""

Here's a four-column comma-delimited example.csv:

5,6,"=HYPERLINK(""http://www.yahoo.com"";""See Yahoo"")",8 

When a spreadsheet program (LibreOffice, etc.) opens this .csv, it creates an active link for you.

like image 23
Steven S. Avatar answered Sep 19 '22 11:09

Steven S.