function increment(a, key) { a[key]++ } { increment(count, $2) } END { print count["labA"], count["labB"] }