Re: sorting logs

2002-08-27 Thread John W. Krahn
Laddo wrote: > > Hi all Hello, > I have a log file which is generated by backup script and i am writing a > perl script to sort the log so as to prepare it to put into mysql > database and iam having a problem in doing that. > > my log file is like this (I have written line numbers for clar

Re: sorting logs

2002-08-27 Thread david
you might want to try: #!/usr/bin/perl -w use strict; my $i = 1; my $min = -1; while(<>){ my($n1,$d1,$b1) = /^INCREMENTAL\s+OF\s+(.+?)\s+.*?ON\s+(.+?)\s+.+\s+(\d+)$/i; $i++ if($b1 < $min); $min = $b1; print "\"$d1\",\"TAPE $i\",\"$n1\",\"$b1\"\n"; } david Laddo

RE: sorting logs

2002-08-27 Thread David . Wagner
Here is the output I got: "2002-08-28","Tape 1", "staff", "315825" "2002-08-28","Tape 2", "www.cs", "102860" "2002-08-28","Tape 2", "staff_homepages", "103142" "2002-08-28","Tape 2", "ftp.cs", "103204" "2002-08-28","Tape 2", "local", "103216" "2002-08-28","Tape 2", "Hyper-G", "103236" "2

Re: sorting logs

2002-08-27 Thread Paul Johnson
On Wed, Aug 28, 2002 at 10:59:13AM +1200, LADDO wrote: > Hi all > > I have a log file which is generated by backup script and i am writing a > perl script to sort the log so as to prepare it to put into mysql > database and iam having a problem in doing that. [ snip ] > i can do it with aw