Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now I have this code to grab the data, and I now want to calculate the averages on each column. Is there an easy way to do that dynamically counting the rows then obviously I would add them and calculate the average:"\\TEST\Memory\Pages/sec" "\\TEST\PhysicalDisk" "06/20/2002 08:27:19.087" "0.87367121907974665" "06/20/2002 08:27:34.088" "3.3339663084377777" "06/20/2002 08:27:49.090" "3.9996207699833071" "06/20/2002 08:28:04.091" "3.198195381472539"
#!C:\Perl\bin\perl use Getopt::Std; $USAGE = <<USAGE; Usage: Absolute_Path\\Logfile A script to retrieve perf numbers and calculate averages USAGE ; # process command line getopts('x') || die $USAGE; # get parameters $Perf = shift || die $USAGE; chomp ($Perf); open (LOG, "$Perf") || die "Error: Couldn't open $Perf : $!\n"; @read = <LOG>; print "Contents of read are: @read\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Formating Text Files
by hotshot (Prior) on Jun 20, 2002 at 15:35 UTC | |
|
Re: Formating Text Files
by robobunny (Friar) on Jun 20, 2002 at 15:48 UTC | |
by Anonymous Monk on Jun 20, 2002 at 16:19 UTC | |
|
Re: Formating Text Files
by DamnDirtyApe (Curate) on Jun 20, 2002 at 15:38 UTC | |
by bronto (Priest) on Jun 20, 2002 at 15:45 UTC |