Branch - branch -master
Hash : 1a08f436 Author : Date : 2010-08-25T09:23:17
Download
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
BEGIN {start = 0; sum = 0} { for (i = 1; i <= NF ; i++) { if ($i == "text") { start = 1; sum = $(i-1); } if (start) { if ((i % 2) == 1) sum = sum + $i; } if ($i == "data") { start = 0; printf "%d\n",sum; } } }