document.write("<div class=\"pastie\">\n");
document.write("  <link href=\"http://pastie.org/stylesheets/embed.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  <link href=\"http://pastie.org/stylesheets/clean.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  \n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("	\n");
document.write("	<div class=\"allcode\">\n");
document.write("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n");
document.write("		<tr>\n");
document.write("			<td>\n");
document.write("				\n");
document.write("				<pre class=\"textmate-source-numbers\">1\n");
document.write("2\n");
document.write("3\n");
document.write("4\n");
document.write("5\n");
document.write("6\n");
document.write("7\n");
document.write("8\n");
document.write("9\n");
document.write("10\n");
document.write("11\n");
document.write("12\n");
document.write("13\n");
document.write("14\n");
document.write("15\n");
document.write("16\n");
document.write("17\n");
document.write("18\n");
document.write("19\n");
document.write("20\n");
document.write("21\n");
document.write("22\n");
document.write("23\n");
document.write("24\n");
document.write("25\n");
document.write("26\n");
document.write("27\n");
document.write("28\n");
document.write("29\n");
document.write("30\n");
document.write("31\n");
document.write("32\n");
document.write("33\n");
document.write("34\n");
document.write("35\n");
document.write("36\n");
document.write("37\n");
document.write("38\n");
document.write("39\n");
document.write("40\n");
document.write("41\n");
document.write("42\n");
document.write("43\n");
document.write("44\n");
document.write("45\n");
document.write("46\n");
document.write("47\n");
document.write("<\/pre>\n");
document.write("			<\/td>\n");
document.write("		<td>\n");
document.write("		<pre class=\"textmate-source\"><pre class=\"sunburst\"><span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'>#!/usr/bin/env ruby -wKU<\/span>\n");
document.write("\n");
document.write("<span class=\'meta meta_require meta_require_ruby\'><span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>require<\/span> <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'rubygems\'<\/span><\/span>\n");
document.write("<span class=\'meta meta_require meta_require_ruby\'><span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>require<\/span> <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'csv\'<\/span><\/span>\n");
document.write("\n");
document.write("<span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@buffer<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'\'<\/span>\n");
document.write("<span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>0<\/span>\n");
document.write("\n");
document.write("<span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@output_lines<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> []\n");
document.write("\n");
document.write("<span class=\'meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby\'><span class=\'keyword keyword_control keyword_control_def keyword_control_def_ruby\'>def<\/span> <span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>print_buffer<\/span><\/span>\n");
document.write("  pieces <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@buffer<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>split<\/span><\/span>\n");
document.write("  <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@output_lines<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby\'>&lt;&lt;<\/span> [pieces<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>shift<\/span><\/span>,pieces<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>shift<\/span><\/span>,pieces<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>join<\/span><\/span>(<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot; &quot;<\/span>)]\n");
document.write("<span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("\n");
document.write("<span class=\'meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby\'><span class=\'keyword keyword_control keyword_control_def keyword_control_def_ruby\'>def<\/span> <span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>parse_statement<\/span>(<span class=\'variable variable_parameter variable_parameter_function variable_parameter_function_ruby\'>statement<\/span>)<\/span>\n");
document.write("  f <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'support support_class support_class_ruby\'>File<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>open<\/span><\/span>(statement)\n");
document.write("\n");
document.write("  f<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>readlines<\/span><\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>each<\/span><\/span> <span class=\'keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block\'>do <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>line<\/span>|\n");
document.write("\n");
document.write("    <span class=\'keyword keyword_control keyword_control_ruby\'>if<\/span> line <span class=\'keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby\'>=~<\/span> <span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>/<\/span><span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>^<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\d<\/span><span class=\'string string_regexp string_regexp_arbitrary-repitition string_regexp_arbitrary-repitition_ruby\'>{2}<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\/<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\d<\/span><span class=\'string string_regexp string_regexp_arbitrary-repitition string_regexp_arbitrary-repitition_ruby\'>{2}<\/span><\/span><span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>/<\/span>\n");
document.write("      print_buffer\n");
document.write("      <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@buffer<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> line<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>chop<\/span><\/span>\n");
document.write("      <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>1<\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_ruby\'>elsif<\/span> (<span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby\'>&gt;<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>0<\/span>)\n");
document.write("      <span class=\'keyword keyword_control keyword_control_ruby\'>if<\/span> <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby\'>&lt;<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>4<\/span>\n");
document.write("        <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@buffer<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby\'>+=<\/span> line<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>chop<\/span><\/span>\n");
document.write("        <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby\'>+<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>1<\/span>\n");
document.write("      <span class=\'keyword keyword_control keyword_control_ruby\'>else<\/span>\n");
document.write("        <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@txn_line<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'constant constant_numeric constant_numeric_ruby\'>0<\/span>\n");
document.write("      <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_ruby\'>else<\/span>\n");
document.write("\n");
document.write("    <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("  <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("<span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("\n");
document.write("[<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'jan\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'feb\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'mar\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'apr\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'may\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'jun\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'jul\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'aug\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'sep\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'oct\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'nov\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'dec\'<\/span>]<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>each<\/span><\/span> <span class=\'keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block\'>do <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>mon<\/span>|\n");
document.write("  <span class=\'meta meta_function-call meta_function-call_ruby\'><span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>parse_statement<\/span><\/span>(<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;<span class=\'source source_ruby source_ruby_embedded source_ruby_embedded_source\'>#{mon}<\/span>08.txt&quot;<\/span>)\n");
document.write("<span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("\n");
document.write("<span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>CSV<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>open<\/span><\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'all_txns_2008.csv\'<\/span>, <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'w\'<\/span>) <span class=\'keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block\'>do <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>csv<\/span>|\n");
document.write("  <span class=\'variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby\'>@output_lines<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>each<\/span><\/span> <span class=\'keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block\'>do <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>line<\/span>|\n");
document.write("    csv <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby\'>&lt;&lt;<\/span> line\n");
document.write("  <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("  csv<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>close<\/span><\/span>\n");
document.write("<span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("<\/pre><\/pre>\n");
document.write("		<\/td>\n");
document.write("		<\/tr>\n");
document.write("		<\/table>\n");
document.write("	\n");
document.write("	<\/div>\n");
document.write("\n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("  <div class=\"credit\">\n");
document.write("    <div class=\"buttons\">\n");
document.write("      <a href=\"http://pastie.org/pastes/447623.txt\">\n");
document.write("      <img src=\"http://pastie.org/images/view.png\" height=\"20\" width=\"67\" /><\/a>\n");
document.write("    <\/div>\n");
document.write("  \n");
document.write("    <a href=\"http://pastie.org/447623\">Pastie #447623<\/a> linked directly from <a href=\"http://pastie.org/\">Pastie<\/a>.\n");
document.write("  <\/div><\/div>");
