<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tim Keller &#187; csv</title>
	<atom:link href="http://timkeller.me/tag/csv/feed/" rel="self" type="application/rss+xml" />
	<link>http://timkeller.me</link>
	<description>Thoughts on Technology and the future of Learning</description>
	<lastBuildDate>Sun, 15 Jan 2012 21:14:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CSV to HTML</title>
		<link>http://timkeller.me/2009/01/19/csv-to-html/</link>
		<comments>http://timkeller.me/2009/01/19/csv-to-html/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 18:06:19 +0000</pubDate>
		<dc:creator>Tim Keller</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://timk.co.za/?p=62038105</guid>
		<description><![CDATA[I produce websites for a lot of school&#8217;s in and around Cape Town. It&#8217;s something I started doing when I was in High School, and it&#8217;s kinda stuck. Last night I received a Word document with pages of teacher&#8217;s names &#8230; <a href="http://timkeller.me/2009/01/19/csv-to-html/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="clear: both">I produce websites for a lot of school&#8217;s in and around Cape Town. It&#8217;s something I started doing when I was in High School, and it&#8217;s kinda stuck.</p>
<p style="clear: both">Last night I received a Word document with pages of teacher&#8217;s names and email addresses for a website. As I looked at it I imagined the huge amount of time I was about to waste either in a WYSIWYG editor or copying and pasting HTML tags.</p>
<p style="clear: both">
<p style="clear: both">Then I remembered that I had a B.Sc and more than 2 brain cells. I moved the Word Table to iWork Numbers (Excel would have worked just as well), exported the file as a CSV document, pulled open Textedit and wrote a quick PHP-CLI script to suck in the CSV and output the relevant HTML.</p>
<p style="clear: both">
<p style="clear: both">Hope it&#8217;s useful to someone else out there!</p>
<p style="clear: both">
<pre style="clear: both">#!/usr/bin/php
<?php
$filename = $argv[1];
$lines = file($filename);
foreach ($lines as $line) {
    list($job, $name, $email) = explode(",",trim($line));
    echo "<b>$job</b>: <a href='mailto:$email'>".htmlspecialchars($name)."</a><br/>n";
}
?></pre>
<p><br class="final-break" style="clear: both" /></p>
]]></content:encoded>
			<wfw:commentRss>http://timkeller.me/2009/01/19/csv-to-html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

