<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.townx.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>townx - A script for parsing work log files - Comments</title>
 <link>http://www.townx.org/blog/elliot/script-parsing-work-log-files</link>
 <description>Comments for &quot;A script for parsing work log files&quot;</description>
 <language>en</language>
<item>
 <title>reply</title>
 <link>http://www.townx.org/blog/elliot/script-parsing-work-log-files#comment-44294</link>
 <description>&lt;p&gt;This page can easily provide good information that will people, prefer individuals. With any luck in which you’ve composed may be a great deal more effective to go on to publish your own sales messages. Are grateful for this specific really educational ad. &lt;a href=&quot;http://www.shpe-iit.org/code-promo-asos-rend-votre-shopping-agreable/&quot;&gt;solang&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Wed, 02 Jan 2013 09:27:02 -0600</pubDate>
 <dc:creator>solang</dc:creator>
 <guid isPermaLink="false">comment 44294 at http://www.townx.org</guid>
</item>
<item>
 <title>cute script!</title>
 <link>http://www.townx.org/blog/elliot/script-parsing-work-log-files#comment-40224</link>
 <description>&lt;p&gt;I love things that make lists.. this looks really useful.. must be my virgo tendancies coming out!&lt;/p&gt;</description>
 <pubDate>Thu, 31 Dec 2009 19:30:58 -0600</pubDate>
 <dc:creator>Auto Approved Blogs</dc:creator>
 <guid isPermaLink="false">comment 40224 at http://www.townx.org</guid>
</item>
<item>
 <title>good job</title>
 <link>http://www.townx.org/blog/elliot/script-parsing-work-log-files#comment-40209</link>
 <description>&lt;p&gt;Interesting script. I always learn a lot from your posts and really appreciate it! I wish you a Happy New Year. Regards, Martin&lt;/p&gt;</description>
 <pubDate>Mon, 28 Dec 2009 07:17:34 -0600</pubDate>
 <dc:creator>swarovski strass</dc:creator>
 <guid isPermaLink="false">comment 40209 at http://www.townx.org</guid>
</item>
<item>
 <title>A script for parsing work log files</title>
 <link>http://www.townx.org/blog/elliot/script-parsing-work-log-files</link>
 <description>&lt;p&gt;Attached is my Ruby script for parsing log files I keep at work. I have to complete a weekly report, and this forms the basis of that; as I don&#039;t keep regular office hours (I flexi-work around child care), it also helps me keep track of the hours I&#039;ve worked.&lt;/p&gt;

&lt;p&gt;The basic principle of operation is as follows:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;I create a file for each working week, called something like week45.log&lt;/li&gt;
&lt;li&gt;During the week, I record bits of activity I do (see below); I also note down stuff I plan to do next (again, see below)&lt;/li&gt;
&lt;li&gt;At the end of the week, I run &lt;code&gt;parse_work_log &amp;lt;file name&amp;gt; &amp;gt; summary.out&lt;/code&gt; on the file to produce a log of what I&#039;ve done&lt;/li&gt;
&lt;li&gt;If anything goes wrong, I tend to edit the work log and regenerate, so I can just keep the log (not the summary)&lt;/li&gt;
&lt;li&gt;I cut and paste from the &lt;code&gt;summary.out&lt;/code&gt; file into an email I send round&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;The format of the file is deliberately simple to make it easy to maintain; there are a handful of formatting rules. An example is shown below.&lt;/p&gt;



&lt;pre&gt;
**********
2009-12-21

09:30-12:00    Researching this and that #research
12:00-13:00    -Lunch
13:00-14:00    More research
14:00-18:00    Writing some application #coding

**********
2009-12-22

09:30-10:00    Admin #Admin
10:00-10:15    -Break
10:00-12:00    Found out something rather marvellous #Very important research
12:00-12:45    -Lunch
12:45-18:00    Writing another application #coding

**********
+NEXT Have lots of fun banging my head on a brick wall
+NEXT Reinstall my operating system
&lt;/pre&gt;



&lt;p&gt;Which, when parsed, produces this on stderr:&lt;/p&gt;



&lt;pre&gt;
*************************************

Worked 15.25 hours
&lt;/pre&gt;



&lt;p&gt;And this on stdout:&lt;/p&gt;



&lt;pre&gt;
*************************************
This week:

Admin:

  * Admin

Very important research:

  * Found out something rather marvellous

coding:

  * Writing some application
  * Writing another application

research:

  * Researching this and that

*************************************
Next:

  * Have lots of fun banging my head on a brick wall
  * Reinstall my operating system
&lt;/pre&gt;



&lt;p&gt;Notes on formatting:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;The asterisks and dates are just there to make it more readable - they&#039;re basically ignored&lt;/li&gt;
&lt;li&gt;An entry is a single line with the format &lt;code&gt;HH:MM-HH:MM &amp;lt;...whitespace...&amp;gt; &amp;lt;text&amp;gt; &amp;lt;#optional tag&amp;gt;\n&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The time span for an entry is added to the total time, unless the entry text contains &lt;code&gt;-Lunch&lt;/code&gt; or &lt;code&gt;-Break&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;#&lt;/code&gt; creates a tagged entry which gets included in the report; it appears as a bullet point with the tag as its heading; any entries with the same tag get aggregated under a single heading; tags and entries appear in the order they occur in the file&lt;/li&gt;
&lt;li&gt;Any line starting with &lt;code&gt;+NEXT&lt;/code&gt; gets listed in the &lt;em&gt;Next&lt;/em&gt; section at the end; tags don&#039;t work on this (could, but don&#039;t at the moment)&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;It is pretty primitive, but it does the job for me.&lt;/p&gt;

&lt;p&gt;Installation: there isn&#039;t any, really. It works from the command line and needs Ruby. The licence? &lt;span class=&quot;caps&quot;&gt;BSD,&lt;/span&gt; I guess.&lt;/p&gt;</description>
 <comments>http://www.townx.org/blog/elliot/script-parsing-work-log-files#comments</comments>
 <category domain="http://www.townx.org/tech">tech</category>
 <category domain="http://www.townx.org/code">code</category>
 <enclosure url="http://www.townx.org/files/parse_work_log" length="1669" type="application/octet-stream" />
 <pubDate>Wed, 23 Dec 2009 18:20:05 -0600</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">789 at http://www.townx.org</guid>
</item>
</channel>
</rss>
