On 4/11/07, Craig Schneider <[EMAIL PROTECTED]> wrote:
Hi Guys

Thanks for all the help with the directory sorting, I'm still very new
to Perl :)

I'm now trying to use Perl to convert the below log file to CSV.

1176301248.555    180 dhr-hr3.duys.co.za TCP_MISS/200 447 GET
http://support.duys.co.za/DUYSIT/WebResource.axd? - DIRECT/192.168.10.3
image/gif

Is there any easy way to do this?


There's probably an offical CPAN module to do this but here is
something quick and dirty.

#!/usr/bin/perl -w
use strict;
use warnings;

my $str = "1176301248.555   180 dhr-hr3.duys.co.za TCP_MISS/200 447
GET http://support.duys.co.za/DUYSIT/WebResource.axd? -
DIRECT/192.168.10.3 image/gif";

print join(",",my @data = split/\s+/,$str);

Thanks for all the help.

c

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/





--
Rodrick R. Brown

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to