How to have the sed output side by side?

后端 未结 6 1901
忘了有多久
忘了有多久 2021-01-22 10:55

I want to have standard output for KEGG pathways of a gene placed side by side no matter how many lines of the KEGG pathways it has. For example, a gene TT123456 is involves in

6条回答
  •  礼貌的吻别
    2021-01-22 11:08

    Using awk:

    awk 'ORS="\t"' file
    

    $ awk 'ORS="\t"' file
    Valine, leucine and isoleucine degradation      Histidine metabolism    Ascorbate and aldarate metabolism       Lysine degradation      Glycerolipid metabolism 
    

    If you wish to use sed then:

    $ sed ':a;N;s/\n/\t/;ba' file
    Valine, leucine and isoleucine degradation      Histidine metabolism    Ascorbate and aldarate metabolism       Lysine degradation      Glycerolipid metabolism
    

提交回复
热议问题