parsing table using linux commands
Hi i have a two column table as below
Code:
Bra033296 GO:0006355 Code:
Bra033296 GO:0006355, GO:0003677, GO:0005634 Thanks |
yes, sure, it is possible, you need to select the tools you want to use: awk/perl/sed.... What do you prefer?
|
Quote:
Thanks....I don't have any preference. |
What about awk?
Code:
awk '{ _[$1] ? _[$1] = _[$1] ", " $2 : _[$1] = $2 } END{ for ( i in _ ) printf "%s\t%s\n", i, _[i] }' file |
Thanks it worked
Quote:
Code:
awk '{ _[$1] ? _[$1] = _[$1] "," $2 : _[$1] = $2 } END{ for ( i in _ ) printf "%s\t%s\n", i, _[i] }' |
Please don't use php code tags. There's a bug that keeps them from properly adjusting to the display width. Besides, this isn't php. Just use regular code tags.
Thanks. |
Quote:
|
All times are GMT -5. The time now is 03:56 PM. |