home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / byte-benchmarks3.1 / part01 / pgms / index.awk < prev    next >
Encoding:
AWK Script  |  1992-02-01  |  497 b   |  22 lines

  1. BEGIN    { 
  2.     FS="|" ; 
  3.     sum=0.00; 
  4.     n=0;
  5.     printf("\n                     INDEX VALUES            \n");
  6.     printf("TEST%40sBASELINE     RESULT      INDEX\n\n","");
  7.  
  8.     }
  9.  
  10.     { # process all lines - use geometric means
  11.     idex = $10/$5;
  12.     sum += idex;
  13.     ++n;
  14.     printf("%-40s  %10.1f %10.1f %10.1f\n",$1,$5,$10,idex);
  15.     }
  16.  
  17. END    {
  18.     printf("              %30s                     =========\n","");
  19.     printf("     SUM of %2d items  %30s  %20.1f\n",n,"",sum);
  20.     printf("     AVERAGE          %30s  %20.1f\n","",sum/n);
  21.     }
  22.