fork download
  1. BEGIN {
  2. FS="[/ ]"
  3. OFS=","
  4. split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",month," ")
  5. }
  6. /Date/ {
  7. if ($1==location||location=="") {
  8. print $1
  9. for (i=1;i<=length(sum);i++)
  10. print month[i],sum[i]/count[i]
  11. }
  12. delete sum
  13. delete count
  14. }
  15. /^[0-9]/ {
  16. count[int($1)]++
  17. sum[int($1)]=sum[int($1)]+$5
  18. }
  19.  
Success #stdin #stdout 0.02s 4232KB
stdin
02/91   45.67       
01/91   54.56       
Eastview/EV977       Date, Simulated    
REGION = ARA ---------------------------------          

02/13   67.83077701 
01/13   71.07555385 
12/12   59.29651502 
03/93   42.95556699 
02/93   52.82357496 
01/93   39.29539609 
12/92   46.36870196 
11/92   49.91787601 
10/92   56.54098106 
09/92   24.80315524 
08/92   26.69060562 
07/92   35.54487173 
06/92   44.63729125 
05/92   38.82535638 
04/92   59.17052297 
03/92   63.74148238 
02/92   39.54410249 
01/92   40.94643107 
12/91   36.73035389 
11/91   59.78663005 
10/91   42.01960281 
09/91   28.15509992 
08/91   28.53445471 
07/91   33.50030035 
06/91   41.26555885 
05/91   65.20709691 
04/91   56.61537973 
03/91   47.19937152 
02/91   50.65750607 
01/91   47.53815129 
Boston1/E0023        Date, Simulated
REGION = ARA --------------------------------- 
stdout
Eastview
Jan,54.56
Feb,45.67
Boston1
Jan,49.7139
Feb,52.714
Mar,51.2988
Apr,57.893
May,52.0162
Jun,42.9514
Jul,34.5226
Aug,27.6125
Sep,26.4791
Oct,49.2803
Nov,54.8523
Dec,47.4652