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?
Peter KromanSales ExecutiveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
>> 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.
0
Peter KromanSales ExecutiveAuthor Commented:
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
0
Pawan KumarDatabase ExpertCommented:
>>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.
0
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Peter KromanSales ExecutiveAuthor Commented:
I am editing in the Excel file and importing it to MySQL.
0
Pawan KumarDatabase ExpertCommented:
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.
0
Peter KromanSales ExecutiveAuthor Commented:
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 :)
0
Pawan KumarDatabase ExpertCommented:
What editing you need ?
0
Peter KromanSales ExecutiveAuthor Commented:
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.
0
als315Commented:
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
0
Pawan KumarDatabase ExpertCommented:
You can use below to extract the url -

Option 1: If you want to run this operation one time
Open up a new workbook.
Get into VBA (Press Alt+F11)
Insert a new module (Insert > Module)
Copy and Paste the Excel user defined function below
Press F5 and click “Run”
Get out of VBA (Press Alt+Q)
Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub

Open in new window


from - Ref
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Peter KromanSales ExecutiveAuthor Commented:
Thanks to Als315 and Kumar,

@Kumar - your excel makro was just what I was searching for. It works perfectly. Thanks a lot :)
0
Pawan KumarDatabase ExpertCommented:
Welcome. Glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.