How Can I Make a Long List of URLs Clickable?
May 3, 2006 7:22 PM   Subscribe

MakeMyPhotosClickableFilter: I have a list of URLs that is about 2000 long. The problem is that none of them begin with http:// and are therefore not "clickable." I need to post this list on my website and allow people to click on the links, rather than cut n paste and have them add the http:// ..... What method could I use to add the http:// and make it "clickable" without actually typing it into each url one-by-one (which would take me forever). Examples of the URLs are below (they are non-working, I just made them up - but are similar to the long list I have)..... Is there *anything* I could use, paste my list into, etc. that would automatically make them clickable?
posted by Gerard Sorme to Computers & Internet (23 answers total)
There are a thousand different ways to do this, I'm sure this post will see some more creative ones...

One way to do it is to open up an excel spreadsheet, and paste your list of URLs into the spreadsheet. You should now have one column with a URL in each of 2000 cells.

Then, insert a column to the left of that column. fill it up with http://. Then merge the two columns (look for help in Excel under "merge cells")
posted by Brian James at 7:28 PM on May 3, 2006

you could open the list in vi and substitute the beginning of each line with http://

To do that,

The /'s in http:// have to be escaped, hence the backslashes.
posted by neilkod at 7:31 PM on May 3, 2006

Best answer: Copy and paste into word.

Go to Edit--->Replace.

In the find box, put "^p"

In the replace box, put "^phttp://"

posted by kingjoeshmoe at 7:31 PM on May 3, 2006

Response by poster: Thanks, Brian, for the suggestion. It's a good one - except - I am one of the few people you will come across who doesn't even own Excel or a spreadsheet program. I have no need to use them in my work, hobbies, etc. Thanks though!
posted by Gerard Sorme at 7:31 PM on May 3, 2006


posted by neilkod at 7:32 PM on May 3, 2006

Response by poster: King Joe - brilliant idea! I am going to give it a try now. I would then just convert the Word document to a basic html page. I'll give it a shot - thanks!
posted by Gerard Sorme at 7:33 PM on May 3, 2006

or, in perl, you could use

perl -pi -e 's/^/http:\/\/' path/to/file
posted by neilkod at 7:34 PM on May 3, 2006

Send me the file (email in profile) and I can do this and have it back to you in a couple of minutes.
posted by special-k at 7:39 PM on May 3, 2006

I'd just use

posted by kcm at 7:41 PM on May 3, 2006

Response by poster: King Joe, I don't have WORD (I use Wordperfect 10), and tried what you said, but it didn't work. Maybe the ^p is a different code in Wordperfect?

I'm not very technical with perl, vi and such.....just basic html.

Arghhh....this seems like it should be easy, but nothing seems to work. I was looking for a "place before" command in the "find and replace" but no such luck.
posted by Gerard Sorme at 7:48 PM on May 3, 2006

I believe Notepad++ is free, small, and supports regular expressions. You can then use one of the Perl/sed expressions as above to do this.
posted by kcm at 7:50 PM on May 3, 2006

Best answer: I fiddled with wordperfect. Here's what looks to work, though I don't claim to understand wordperfect at all:

In find, put: "[Para End (all)]"

In replace, put: "[HRt]http://"

let me know if that works. Tested on WP 9.
posted by kingjoeshmoe at 8:16 PM on May 3, 2006

If you don't have Word, you can just open a blogger account and paste them into the "Posts" textbox and it will link-a-fy them. Then switch to the HTML view and copy them out.
posted by blue_beetle at 8:39 PM on May 3, 2006

Best answer: C:\>(for /f "delims=" %i in (in.txt) do @echo http://%i) > out.txt

posted by aubilenon at 8:49 PM on May 3, 2006

awk was made for this stuff.
posted by evariste at 9:12 PM on May 3, 2006

Best answer: Gerard, the method posted by aubilenon is a really easy way to do it. Just save your list as a text file in your C: called 'in.txt'.

Then, go start->run and type 'cmd'. Make sure the prompt says 'C:\>' and then cut-n-paste this:

(for /f "delims=" %i in (in.txt) do @echo http://%i) > out.txt

Voila! The file out.txt now has all your URL's with a http:// at the front.
posted by ranglin at 9:18 PM on May 3, 2006

BTW, what do you write your HTML in? If none of the above work, maybe someone can suggest a method using your existing HTML editor.
posted by ranglin at 9:19 PM on May 3, 2006

Response by poster: King Joe,

It took me forever how to manipulate Wordperfect using the "code" thing in "Search and Replace" worked!! Thank you!!!
posted by Gerard Sorme at 9:23 PM on May 3, 2006

Re the Excel suggestion - if you don't have Excel, you can do something similar in Word with a table.

Select all your text.
Convert to table (1 column, however-many-rows).
Insert new column to the left of existing column.
Type http:// into the first cell in column one, and then copy & paste to the whole column.
Select table, and convert table to text.
Do a replace all on the leftover tabs (replace the ^t characters).
posted by SuperSquirrel at 7:26 AM on May 4, 2006

No one suggested getting Open Office?
posted by Goofyy at 9:07 AM on May 4, 2006

To actually make it clickable you need to add the HTML tags for it in addition to the 'http://'

Go to the World's Simplest code generator, paste your list into the List box, in the Pattern box select Hyperlink. Since you didn't provide a title for each link as your second column, just replace the $2 variable with $1 and it will use the link itself as the link title. Click Calculate. You can then copy the text that is created in the Calculate box which should be valid html that you can paste into your web page
posted by jacobsee at 12:02 PM on May 4, 2006

Actually, you probably want to get rid of that

title='$2' and replace $2 with $1

so your pattern should be:

<a href="$1">$1</a>
posted by jacobsee at 12:05 PM on May 4, 2006

oops, and to make one link per line you'd need to add paragrash tags, so something like:

<p><a href="$1">$1</a></p>
posted by jacobsee at 12:09 PM on May 4, 2006

« Older Want to buy earbuds for running   |   What is this needle-shaped microorganism? Newer »
This thread is closed to new comments.