Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Success story: Converting logs

by vrk (Chaplain)
on Oct 13, 2007 at 20:31 UTC ( [id://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.

    -Paul

      Well it was "hardcore" what did you expect!
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Success story: Converting logs
by perrin (Chancellor) on Oct 13, 2007 at 22:57 UTC
    Great story!
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Success story: Converting logs
by perlfan (Vicar) 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...;)
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-23 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found