<?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>Ecommerce trends, online retail news and opinion, user experience design : Our Blog : Alexander Interactive &#187; Mike Oristian</title>
	<atom:link href="http://www.alexanderinteractive.com/blog/author/moristian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexanderinteractive.com/blog</link>
	<description>The pulse of Alexander Interactive</description>
	<lastBuildDate>Tue, 07 Feb 2012 23:39:57 +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>Ruby Did My Taxes</title>
		<link>http://www.alexanderinteractive.com/blog/2009/04/ruby-did-my-taxes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-did-my-taxes</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/04/ruby-did-my-taxes/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:56:10 +0000</pubDate>
		<dc:creator>Mike Oristian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[taxes]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/04/ruby-did-my-taxes/</guid>
		<description><![CDATA[Over the weekend, like many Americans, I did my taxes. I&#8217;m required to file a couple of different Schedule C&#8217;s for various side-businesses I have, and when it comes time to hunt for deductions, it sure is nice to be a programmer. I had initially thought that I would be able to download the entire [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend, like many Americans, I did my taxes.  I&#8217;m required to file a couple of different Schedule C&#8217;s for various side-businesses I have, and when it comes time to hunt for deductions, it sure is nice to be a programmer.  </p>
<p>
I had initially thought that I would be able to download the entire year&#8217;s bank transactions into a CSV file, but alas, my bank (and many others, I&#8217;m finding) only provide 45 days of history.  They do, however, allow you to download PDF files of all of your statements, and so there I was staring at thousands of transactions in PDFs, dreading retyping them into Excel. </p>
<p>
Enter my skills as a Rubyist.  I sought out the PDF::Reader library, which allows you to hook its parsing engine to a custom callback and do what you want with it.  This definitely parsed the PDF fine, but I had no context; no idea where I was in my statement, because there&#8217;s no callback for a &#8220;new line&#8221; character &#8211; it&#8217;s just a stream of words.  I found that if I used Adobe Acrobat to save the files as text-accessible, then I started to have statements I was able to work with.   </p>
<p>
Now that I had &#8216;lines&#8217;, I was able to use the power of regular expressions to get the data I needed.  The lines I was interested in started with a date and an amount, and the rest was just description for my transaction. </p>
<p>
Here&#8217;s the warts-and-all code I used to compile the year&#8217;s worth of spreadsheet data.  It&#8217;s truly &#8220;quick-and-dirty&#8221;, but it saved me tons of time.  The next step, of course, would be to implement regular expressions against the &#8216;memo&#8217; field of these transactions, and pre-suppose categories and deductions based on these patterns.  But then again, maybe it&#8217;s time to just use Quicken and stop waiting until the last minute.</p>
<p><script src='http://pastie.org/447623.js'></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/04/ruby-did-my-taxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching using apc
Object Caching 218/238 objects using apc
Content Delivery Network via cdn.at.ai

Served from: www.alexanderinteractive.com @ 2012-02-08 10:07:37 -->
