Code:
awk '{ arr[$1] = arr[$1] ? arr[$1] "," $2 : $2 } END { for (id in arr) { print id, arr[id] } }' input.txt
You are currently viewing the SEQanswers forums as a guest, which limits your access. Click here to register now, and join the discussion
awk '{ arr[$1] = arr[$1] ? arr[$1] "," $2 : $2 } END { for (id in arr) { print id, arr[id] } }' input.txt
g00010 GO:1903046 g00010 GO:1990391 g00020 GO:0000003 g00020 GO:0000075 g00020 GO:0000076
g00010 GO:1903046,GO:1990391 g00020 GO:0000003,GO:0000075,GO:0000076
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 12-02-2024, 09:29 AM
|
0 responses
153 views
0 likes
|
Last Post
by seqadmin
12-02-2024, 09:29 AM
|
||
Started by seqadmin, 12-02-2024, 09:06 AM
|
0 responses
51 views
0 likes
|
Last Post
by seqadmin
12-02-2024, 09:06 AM
|
||
Started by seqadmin, 12-02-2024, 08:03 AM
|
0 responses
44 views
0 likes
|
Last Post
by seqadmin
12-02-2024, 08:03 AM
|
||
Started by seqadmin, 11-22-2024, 07:36 AM
|
0 responses
76 views
0 likes
|
Last Post
by seqadmin
11-22-2024, 07:36 AM
|
Leave a comment: