1*84d9c625SLionel Sambuc# $NetBSD: merge.awk,v 1.1 2013/11/22 16:00:45 christos Exp $ 2*84d9c625SLionel Sambuc# 3*84d9c625SLionel Sambuc# @(#)merge.awk 8.3 (Berkeley) 5/25/94 4*84d9c625SLionel Sambuc# 5*84d9c625SLionel Sambuc# merge index entries into one line per label 6*84d9c625SLionel Sambuc$1 == prev { 7*84d9c625SLionel Sambuc printf ", %s", $2; 8*84d9c625SLionel Sambuc next; 9*84d9c625SLionel Sambuc} 10*84d9c625SLionel Sambuc{ 11*84d9c625SLionel Sambuc if (NR != 1) 12*84d9c625SLionel Sambuc printf "\n"; 13*84d9c625SLionel Sambuc printf "%s \t%s", $1, $2; 14*84d9c625SLionel Sambuc prev = $1; 15*84d9c625SLionel Sambuc} 16*84d9c625SLionel SambucEND { 17*84d9c625SLionel Sambuc printf "\n" 18*84d9c625SLionel Sambuc} 19