Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Success story: Converting logs

by vrk (Chaplain)
on Oct 13, 2007 at 20:31 UTC ( #644674=perlmeditation: print w/replies, xml ) Need Help??

My girlfriend is doing her PhD in sociology, and her research involves interviews with participants and groups online -- MSN, IRC, whatever technology happens to work. She naturally saves logs of these interviews for later analysis.

Recently, I discovered that she was converting the log files to a more suitable format by hand. Since MSN Messenger, for instance, saves its logs in XML, I shuddered at the thought, and immediately offered my Perl skills. Indeed, I was reminded of this comic strip: Regular Expressions

Ten minutes and fifteen lines of code later, using XML::Twig, I had a script that could extract the text data from the log files in a suitable format. One finishing touch was piping the output to fmt(1) to format the paragraphs containing the message strings so that they were properly indented; I indented the first line with a \t in the Perl script already.

Five minutes later I had a five-line script for extracting in the same simple output format text data from irssi log files. Together, my fifteen minutes of effort saved her 12 hours of numb mouse usage and copy-pasting; a 48-fold difference in time spent. (Do you have similar experiences in saving time?)

She also didn't let me leave the bed for a few hours afterwards. Which was nice.

print "Just Another Perl Adept\n";

Replies are listed 'Best First'.
Re: Success story: Converting logs
by jettero (Monsignor) on Oct 14, 2007 at 11:44 UTC

    She also didn't let me leave the bed for a few hours afterwards. Which was nice.

    I'm fond of stories where perl gets you laid... it doesn't come up as much as you'd think.


      Well it was "hardcore" what did you expect!

      If you want to get laid, Python does the magic every time. C# with GUI will kill you.

Re: Success story: Converting logs
by perrin (Chancellor) on Oct 13, 2007 at 22:57 UTC
    Great story!

      Compare with before, it is quite clear that:

      • quality of questions went down
      • quality of meditations went down.
      • The forum is way more quiet than it was.
      • Get less hardcore but brainy guys
      • The site is as slow as before, and sometime almost looks like dead, I guess all because of the technology
Re: Success story: Converting logs
by perlfan (Curate) on Oct 16, 2007 at 23:44 UTC
    Which was nice.

    I dig the Caddy Shack reference, though now have disturbing vision of Bill Murry and the Dali Lama getting it on...;)
Re: Success story: Converting logs
by Cop on Oct 14, 2007 at 01:08 UTC

    What kind of PhD is this?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://644674]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-04-21 22:19 GMT
Find Nodes?
    Voting Booth?