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
You could use tr:
tr
tr '\n' '\t' < inputfile
For your input, it'd produce:
Valine, leucine and isoleucine degradation Histidine metabolism Ascorbate and aldarate metabolism Lysine degradation Glycerolipid metabolism
Using sed:
sed '$!{:a;N;s/\n/\t/;ta}' inputfile