Avatar of Peter Kroman
Peter Kroman
Flag for Denmark asked on

Importing text holding links fra a CSV file to MySQL

Hi,

I have an Excel CSV file with appr. 40.000 lines. This file contains in one column text holding links which I need to use in SQL.
For example:
Sk-rmbillede-2017-11-18-12.58.32.png
When I import the CSV file to MySQL this column is imported as raw text. The field type i use for this column is VARCHAR.

My question is if there is any way that I can import this file in a way so the links embedded in the text gets active and working?
SQL

Avatar of undefined
Last Comment
Pawan Kumar

8/22/2022 - Mon
Pawan Kumar

>> My question is if there is any way that I can import this file in a way so the links embedded in the text gets active and working?

Links active means ? - it will be simple text only. If you select the data from the table it will simple text only.
Peter Kroman

ASKER
Links active means that the links are working as links. And my question is if there is any way I can avoid to manually edit appr. 40.000 lines
Pawan Kumar

>>Links active means that the links are working as links.

No. This is not possible. If you just select the data

And my question is if there is any way I can avoid to manually edit appr. 40.000 lines

Not clear ?? Where are you editing - in the database ?? With proper access one can edit the column.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Peter Kroman

ASKER
I am editing in the Excel file and importing it to MySQL.
Pawan Kumar

Yes we can edit the file since it is in our hands. If you dont want anyone else to edit the you can protect that using password protection.
And if you dont want anyone else to edit the column in DB then you can have to handle its access.
Peter Kroman

ASKER
I think we are talking in opposite directions. This is not about access limitation ot about where things are edited. This is about avoiding the need to manually edit appr. 40.000 lines, no matter if the editing is in the database or in a CSV file which is imported afterwords :)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Pawan Kumar

What editing you need ?
Peter Kroman

ASKER
I need to change the text to a link. For example:

In the field is says: Sk-rmbillede-2017-11-18-14.10.23.pngEmbedded in that text is this link:
https://www.sa.dk/ao-soegesider/da/billedviser?bsid=10706

and it is the link I need to use and not the text.
als315

You can add this function and extract address from hyperlink:
Function extractURL(cell As Range) As String
    extractURL = cell.Hyperlinks(1).Address
End Function

Open in new window

extract_url.xlsm
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Pawan Kumar

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Peter Kroman

ASKER
Thanks to Als315 and Kumar,

@Kumar - your excel makro was just what I was searching for. It works perfectly. Thanks a lot :)
Pawan Kumar

Welcome. Glad to help.