I have a file (sorted by sort) with 8 tab delimited columns. The first column contains duplicated fields and I need to merge all these identical lines.
My input file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba
comp100003 fff fff fff fff fff fff fff
comp100004 xxx xyz xyz xxx xyz xxx xyz
My desired output file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba fff fff fff fff fff fff fff
comp100004 xxx xyz xyz xxx xyz xxx xyz
Thanks a lot, it prints desired results. However, if there is a single-copy identifier in field 1, it appends whole line twice. It's easy to get rid of these 8 additional columns, but since I am learning, could you please comment which part of the code is responsible for this?