User Profile

Collapse

Profile Sidebar

Collapse
jpjacquez
jpjacquez
Last Activity: Nov 5 '08, 08:37 PM
Joined: Oct 14 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jpjacquez
    replied to getting a average value in Perl
    in Perl
    WOW! Thank you very much Kevin! Appreciate it man..

    I didn't know this technique.

    Code:
     
    
    $HoA{$data[0]}[$i-1]+=$data[$i];
    See more | Go to post

    Leave a comment:


  • jpjacquez
    replied to getting a average value in Perl
    in Perl
    if you notice my first question, i made it simple actually. get the average for each occurence of disks. i didn't want to put the code as it may confuse you.. but somebody asked for it..

    making it hard? yes its easy for you...thats the reason i asked your help in the forum..because i don't know how to make it work..

    thanks,
    jewsco
    See more | Go to post

    Leave a comment:


  • jpjacquez
    replied to getting a average value in Perl
    in Perl
    sorry for confusion..repl ace the open with..The begin and End pattern is 00:10:00 and 00:20:00 for example..

    Code:
    open(SAROUT,"/usr/bin/sar -d -f $SarFile |" ) or die "Can't open $!";

    output will be like
    HP-UX cmihx195 B.11.23 U ia64 10/12/08

    Code:
    00:00:00   device   %busy   avque   r+w/s  blks/s  avwait  avserv
    00:10:00   c2t6d0   10.85    1.43      31     755    1.90
    ...
    See more | Go to post
    Last edited by eWish; Oct 15 '08, 11:08 PM. Reason: Please use code tags

    Leave a comment:


  • jpjacquez
    replied to getting a average value in Perl
    in Perl
    here is the code, actually, its just opening and puting it into a hash. I stoped because i not sure how to proceed..

    Code:
    open(SAROUT,"/tmp/input_file" ) or die "Can't open $!";
    
    while(<SAROUT>) {
       chomp;
       s/\s+/ /g; s/^\s+//g;
       $Lines++;
    
       if ( $FoundBegin eq 1 ) {
         print "Lines in between: $_\n";
         ( $Disk, $DiskBusy, $Avque,
    ...
    See more | Go to post
    Last edited by eWish; Oct 15 '08, 11:07 PM. Reason: Please use code tags

    Leave a comment:


  • jpjacquez
    started a topic getting a average value in Perl
    in Perl

    getting a average value in Perl

    There are 4 fields in this input data. I want to get the average value for the column 2/3/4th. If you notice, disk c53t2d6 and c12t10d4 occured twice..so i need to get an average for them. If it occured only once, then just get take it as an average.

    c42t3d0 0.01 0.00 1.19
    c53t2d6 2.00 3.4 1.76
    c12t10d4 0.01 0.00 1.42
    c53t2d6 0.03 0.00 0.59
    c12t10d4 0.02 0.00 0.82

    THanks in advance. I been...
    See more | Go to post
No activity results to display
Show More
Working...