Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Success story: Converting logs

by w-ber (Hermit)
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";

Comment on Success story: Converting logs
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 Cop on Oct 14, 2007 at 01:08 UTC

    What kind of PhD is this?

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.

    -Paul

      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 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...;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://644674]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2014-09-18 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls