<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Converting A Plain Text List Of URLs Into An HTML List of Clickable Links</title>
	<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links/</link>
	<description>Comments on Ask MetaFilter post Converting A Plain Text List Of URLs Into An HTML List of Clickable Links</description>
	<pubDate>Tue, 21 Feb 2006 10:12:44 -0800</pubDate>
	<lastBuildDate>Tue, 21 Feb 2006 10:12:44 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Converting A Plain Text List Of URLs Into An HTML List of Clickable Links</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links</link>	
		<description>What&apos;s the easiest way  to convert a plain text list of URLs with descriptions into an HTML page of clickable links? &lt;br /&gt;&lt;br /&gt; I have a long list of URLs and descriptions in a plain text file, formatted like so&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;### This is a page about monkeys&lt;br /&gt;http://www.monkeypage.com&lt;br /&gt;### This is a page about weasels&lt;br /&gt;http://www.weaselpage.com&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
and would like to convert them into an XHTML list formatted like so&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;li&gt;&lt;a title=&quot;This is a page about monkeys&quot; href=&quot;http://www.monkeypage.com&quot;&gt;This is a page about monkeys&lt;/a&gt;&lt;/li&gt;&lt;br&gt;
&lt;li&gt;&lt;a title=&quot;This is a page about weasels&quot; href=&quot;http://www.weaselpage.com&quot;&gt;This is a page about weasels&lt;/a&gt;&lt;/li&gt;&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
What would be the best way to do a conversion like this? I&apos;m running OS 10.4.5, and I&apos;m guessing a good method would involve command line stuff I&apos;m aware of but don&apos;t really understand - regular expressions, grep, and the like. Alternatively, since the resulting page is destined for the web, I suppose another option would be a PHP or Perl script to convert the text file on the fly (I only mention PHP and Perl because I have some, very limited, experience with them, and would be lost if someone suggested, eg., a Python solution). I also assume some of the more advanced text editors would be up to the job (though from what I&apos;ve seen of them, I&apos;m a bit intimidated by the likes of vim or emacs!)&lt;br&gt;
&lt;br&gt;
If this is a simple proposition, I&apos;d be very grateful if someone could give examples of commands/possible scripts, if not, pointers to resources about manipulating text files in this way would be great too (I keep everything in plain text files, so am keen to learn about manipulating and  repurposing them in general).</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.33038</guid>
		<pubDate>Tue, 21 Feb 2006 10:11:24 -0800</pubDate>
		<dc:creator>jack_mo</dc:creator>
		
			<category>text</category>
		
			<category>manipulation</category>
		
			<category>conversion</category>
		
			<category>texttoHTML</category>
		
			<category>ASCII</category>
		
			<category>HTML</category>
		
			<category>XHTML</category>
		
			<category>URLs</category>
		
			<category>links</category>
		
	</item> <item>
		<title>By: jack_mo</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515345</link>	
		<description>Oops, posting ate the formatting of the HTML I want to convert to. I&apos;ll try again:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;a title=&quot;This is a page about monkeys&quot; href=&quot;http://www.monkeypage.com&quot;&amp;gt;This is a page about monkeys&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;&amp;lt;a title=&quot;This is a page about weasels&quot; href=&quot;http://www.weaselpage.com&quot;&amp;gt;This is a page about weasels&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515345</guid>
		<pubDate>Tue, 21 Feb 2006 10:12:44 -0800</pubDate>
		<dc:creator>jack_mo</dc:creator>
	</item><item>
		<title>By: ajr</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515363</link>	
		<description>I would use a wiki.  Most feature mark-up that allow you to convert text into a link by doing the following:&lt;br&gt;
&lt;br&gt;
&quot;This is a page about weasels&quot;:http://www.weaselpage.com&lt;br&gt;
&lt;br&gt;
I&apos;m sure with a little batch file or excel processing you could convert your text file into the following mark-up, upload it into a wiki, then export the html file.  Notably, &lt;a href=&quot;http://www.instiki.org&quot;&gt;Instiki&lt;/a&gt; (site not responding for me right now) would make this pretty easy.  &lt;a href=&quot;http://www.stikipad.com&quot;&gt;Stikipad&lt;/a&gt; is also a great hosted wiki app that will do this for you.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515363</guid>
		<pubDate>Tue, 21 Feb 2006 10:30:46 -0800</pubDate>
		<dc:creator>ajr</dc:creator>
	</item><item>
		<title>By: maxpower</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515364</link>	
		<description>I&apos;ve done this in excel using simple formula&apos;s, find and replace. then putting the link together using concatenate (&amp;amp;).  It took about 5 minutes to set up.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515364</guid>
		<pubDate>Tue, 21 Feb 2006 10:32:40 -0800</pubDate>
		<dc:creator>maxpower</dc:creator>
	</item><item>
		<title>By: bcwinters</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515365</link>	
		<description>A BBEdit find and replace will do this no problem, if the input is as regular as it seems. I think the syntax would be something along the lines of:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Find: ### (*.)\r(http*.)&lt;br&gt;
Replace with: &amp;lt;li&amp;gt;&amp;lt;a title=&quot;\1&quot; href=&quot;\2&quot;&amp;gt;\1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Basically, The First Thing You Put In Parentheses can be referenced in the replace as \1 and The Second Thing You Put In Parentheses is \2, etc etc.&lt;br&gt;
&lt;br&gt;
\r is the code for a hard return. \t is the code for a tab, in case you needed that.&lt;br&gt;
&lt;br&gt;
BBEdit&apos;s manual has a great section on find and replace and how to use regular expressions that has great real world examples. It&apos;s written for semi-nerdy ordinary people who have no experience with this kind of stuff.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515365</guid>
		<pubDate>Tue, 21 Feb 2006 10:32:46 -0800</pubDate>
		<dc:creator>bcwinters</dc:creator>
	</item><item>
		<title>By: cillit bang</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515381</link>	
		<description>&lt;a href=&quot;http://ask.metafilter.com/mefi/32209&quot;&gt;Thread from two weeks ago&lt;/a&gt; on exactly the same thing.&lt;br&gt;
&lt;br&gt;
You can use &lt;a href=&quot;http://www.barebones.com/products/textwrangler/index.shtml&quot;&gt;Textwrangler&lt;/a&gt; in place of BBEdit. It&apos;s a free download.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515381</guid>
		<pubDate>Tue, 21 Feb 2006 10:46:58 -0800</pubDate>
		<dc:creator>cillit bang</dc:creator>
	</item><item>
		<title>By: Rhomboid</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515446</link>	
		<description>&lt;code&gt;perl -e &apos;local $/; $_ = &amp;lt;&amp;gt;; print &quot;&amp;lt;li&amp;gt;&amp;lt;a title=\&quot;$1\&quot; href=\&quot;$2\&quot;&amp;gt;$1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;\n&quot; while(m,^###\s+(.*?)$(.*?)$,smg);&apos; &amp;lt; input.txt &amp;gt; output.txt&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515446</guid>
		<pubDate>Tue, 21 Feb 2006 11:24:52 -0800</pubDate>
		<dc:creator>Rhomboid</dc:creator>
	</item><item>
		<title>By: jack_mo</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515482</link>	
		<description>Damn, no idea how I managed to miss that earlier thread, which would have given me enough to go on.&lt;br&gt;
&lt;br&gt;
Thanks everyone for the examples and tips (I just used Rhomboid&apos;s, and it worked treat, but will be investigating TextWrangler further too).</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515482</guid>
		<pubDate>Tue, 21 Feb 2006 11:50:38 -0800</pubDate>
		<dc:creator>jack_mo</dc:creator>
	</item><item>
		<title>By: scruss</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#515779</link>	
		<description>This is what awk is for:&lt;br&gt;
&lt;pre&gt;awk &apos;/^###/ {sub(/^### /, &quot;&quot;); text=$0;} &lt;br&gt;
/^http/ {print &quot;&amp;lt;li&amp;gt;&amp;lt;a href=\&quot;&quot;$0&quot;\&quot;&amp;gt;&quot; text &quot;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;}&apos; input.txt &amp;gt; output.txt&lt;/pre&gt;&lt;br&gt;
(ignore the line break)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-515779</guid>
		<pubDate>Tue, 21 Feb 2006 16:17:49 -0800</pubDate>
		<dc:creator>scruss</dc:creator>
	</item><item>
		<title>By: SupaDave</title>
		<link>http://ask.metafilter.com/33038/Converting-A-Plain-Text-List-Of-URLs-Into-An-HTML-List-of-Clickable-Links#516342</link>	
		<description>You could use MS Word (or other word processors I&apos;m assuming). &lt;br&gt;
The only downside is you have to manually hit the ENTER key after each link.&lt;br&gt;
&lt;br&gt;
You could also use Excel... Make a list of the text you have and a list of the text you want. Using the &amp;amp; function you can merge the individual cells. You may have to fool around with it a bit... but it seems like it may be quicker and easier than BBEdit or equivalents, if you&apos;re not familiar with them.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33038-516342</guid>
		<pubDate>Wed, 22 Feb 2006 06:31:32 -0800</pubDate>
		<dc:creator>SupaDave</dc:creator>
	</item>
	</channel>
</rss>
