I would like to ask for some hints in how to merge rows that share unique IDs into a comma separated table. Any hints in Perl, sed or awk are greatly appreciated.
This i
$ cat data.txt protein_id go_id 4102 GO:0003676 4125 GO:0003676 4125 GO:0008270 4139 GO:0008270 $ perl -aE'sub a{say"$a\t",join", ",@a if$a;@a=($F[1]);$a=$F[0]}$F[0]eq$a?push@a,$F[1]:a()}{a()' data.txt protein_id go_id 4102 GO:0003676 4125 GO:0003676, GO:0008270 4139 GO:0008270