Mike Singleton wrote:
> To keep this simple.
> On the text string I would like to:
> Simple plan:
> 1. replace all spaces with commas
> 2. strip all information before the date
>
> === Text string ====
> 172.16.54.132 ssjobhnd Sun Jun 16 10:40:10 2002 SNBJH_3710J Task 1: KB transferred
>8124972.2 Task time 830 s. Throughput 9789.1 KB/s
> 172.16.54.132 ssevthnd Mon Jun 17 19:06:21 2002 SNBEHT4204E 408: *** Error mounting
>SBA232 on device Drive2_001 [status: 1104 (error opening device file)] ***
> 172.16.54.132 ssjobhnd Mon Jun 17 19:06:21 2002 SNBJH_3036E *** Drive fail reported:
>drive Drive2_001 on node Mstrbkp in job 1024365603 ***
> === End Text String ===
>
> ==== Sample code (which doesn't seem to work)====
> # ERROR - global symbol $str requires explicit package
>
> use strict;
> while(<>) {
> $str =~ s/\s/,/g;
> ($keep) = $str =~ /(\w{3} \w{3} .*)/;
Drop the $str from above two lines:
s/\s/,/g;
s/^.*?(\w{3} \w{3}\s+\d+.*)$/$1/; # modified slightly
> print;
> }
>
> ===== end script====
--
,-/- __ _ _ $Bill Luebkert ICQ=162126130
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs