Monitoring du Phytotron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

av4v-h.awk 426B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/awk -f
  2. BEGIN {
  3. flag_debut = 1;
  4. lasthour = 0;
  5. cumul = 0.0;
  6. compte = 0;
  7. }
  8. # iterate over all the input lines
  9. {
  10. if (flag_debut) {
  11. debut = $1
  12. flag_debut = 0
  13. }
  14. heures = int(($1-debut) / 3600);
  15. if (heures == lasthour) {
  16. val = ($2 + $3 + $4 + $5);
  17. cumul += val;
  18. compte += 4;
  19. }
  20. else {
  21. val = cumul /compte;
  22. print $1, val;
  23. lasthour = heures;
  24. cumul = 0;
  25. compte = 0;
  26. }
  27. }