I need to rename a number of files. These are graphic jpg files, and I have an Excel table in which the initial names of these files are collected. For example, this is the name of one of these files taken from the table:


My problem is that the above name in my Excel file is a hyperlink, rather than a string. By directly addressing this hyperliknk from Mathematica a notebook with a mess inside opens, instead of the desired image. My question is:

How could I clean the text of this file name off from its hyperlink property, such that after the cleaning I get a pure string "121026_DeviceData\63486504438_Osc.jpg" instead of the hyperlink?

Added later: I have found such an approach:


that returns me a string:


With this the question is answered, though somebody might propose a better solution.

  • 1
    $\begingroup$ Could you maybe upload a small sample of your Excel table somewhere, for testing purposes? $\endgroup$ – J. M.'s technical difficulties Nov 12 '12 at 12:02
  • $\begingroup$ I have found such an approach: $\endgroup$ – Alexei Boulbitch Nov 12 '12 at 12:21
  • $\begingroup$ I do not want to do this, since the table contains lots of things nothing to do with the question. No problem to operate with the table. It easily transforms into the table in Mathematica and can be operated further by the Mathematica methods. Now that I answered the question the rest is trivial. $\endgroup$ – Alexei Boulbitch Nov 12 '12 at 12:30

Generating a XLS file for testing purposes:



Import["G:\\stackexchange\\hypli.xls"] /. Hyperlink[a_, _] :> a


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.