DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Looking for a linkification tool  (Read 10,076 times)

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 413
Looking for a linkification tool
« on: April 13, 2011, 12:41 PM »
Here is my problem:

I need to paste tons and tons of URLs into html files, and make them links as well.

In other words, I have addresses like this:
Code
http://url1
http://url2
http://url3

and so on...

I need to make them look like this:

Code
<a href="http://url1">http://url1</a><br>
<a href="http://url2">http://url2</a><br>
<a href="http://url3">http://url3</a><br>

Can you think of a solution? I currently use a combination of excel and notepad, but I feel there must be a better way.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Looking for a linkification tool
« Reply #1 on: April 13, 2011, 01:09 PM »
Here you go:  Linkifier

2011-04-13_080817.png
« Last Edit: April 13, 2011, 02:45 PM by skwire »

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 413
Re: Looking for a linkification tool
« Reply #2 on: April 13, 2011, 01:12 PM »
Here you go:  Linkifier

Are you the greatest or what?

Thanks a zillion.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Looking for a linkification tool
« Reply #3 on: April 13, 2011, 01:12 PM »
If you ever need to do something more customized...Macros in Notepad++, Emacs, etc. might be worth checking out:

Notepad++ Macros:

  http://npp-community.tuxfamily.org/documentation/notepad-user-manual/macros
  http://www.rarst.net/software/notepadpp-macro-for-repetitive/

Emacs Keyboard Macros:

  http://www.emacswiki.org/emacs/KeyboardMacros

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Looking for a linkification tool
« Reply #4 on: April 13, 2011, 01:13 PM »
Here you go:
Oh, it's him again :D :D

Or maybe Excel2HTML could help here (but it could need a small functional change)?
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Looking for a linkification tool
« Reply #5 on: April 13, 2011, 01:15 PM »
Are you the greatest or what?
Yep, he is :Thmbsup:
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Looking for a linkification tool
« Reply #6 on: April 13, 2011, 01:17 PM »
Skwire, it's nice enough of you to try to help, but can't you speed it up a bit?
It's taking you almost haf an hour!

:up: :up: :up:
Chris

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Looking for a linkification tool
« Reply #7 on: April 13, 2011, 01:19 PM »
Skwire, it's nice enough of you to try to help, but can't you speed it up a bit?
It's taking you almost haf an hour!

It would have been quicker but I had to take my daughters to school first.  Priorities, I know.  :P

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Looking for a linkification tool
« Reply #8 on: April 13, 2011, 01:34 PM »
The general problem is solved with regular expressions. They take a little bit to learn, but they give you god-like power.

For a simple example like that, search for:

^(.+)$

And replace with:

<a href="\1">\1</a><br>

The problem is very common with many, many more variations. The general principles in regular expressions let you solve them all very quickly.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Looking for a linkification tool
« Reply #9 on: April 14, 2011, 10:19 PM »
Perhaps the "replace with" portion of Renegade's post got mangled by the forums...

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Looking for a linkification tool
« Reply #10 on: April 14, 2011, 11:26 PM »
Perhaps the "replace with" portion of Renegade's post got mangled by the forums...

Yes. It did. Here it is again with spaces inserted:

< a href = "\1" > \1 < /a >< br >

Hopefully that will turn out ok.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Looking for a linkification tool
« Reply #11 on: April 15, 2011, 08:54 AM »
Seems like it came out fine :)

FWIW, wrapping in a code tag seems to provide some degree of protection:

some-mangling-protection-via-code-tag.png

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Looking for a linkification tool
« Reply #12 on: April 17, 2011, 11:38 PM »
Seems like it came out fine :)

FWIW, wrapping in a code tag seems to provide some degree of protection:
(see attachment in previous post)
Another option is to use the "no BBC" tag (unrelated with the british broadcast, AFAIK :P ). There's a red button there, of you prefer you can write it directly: [nobbc][/nobbc]

ps: cool, it even works for the tag itself :)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Looking for a linkification tool
« Reply #13 on: April 17, 2011, 11:41 PM »
Nice!  Thanks for pointing that out :)

Original address: https://www.donationcoder.com/forum/index.php?topic=26390.0