954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

triming lines using shell command

Hello,

i have a problem and need your help

i have a text file generated automatically from a script , but the result in the script is not ordered in a readable way, so i need your help to fix it using a shell command

the text file contain data in this way :

0.147361	0.243688	0.081520	-0.446603	1.130529	NC_000846 Chordata  
 Rheiformes  
 Aves  
	
0.091740	0.379224	0.021160	-0.088493	3.441356	NC_000857 Arthropoda  
 Diptera  
 Insecta  
	
0.169093	0.265700	0.030083	-0.262037	1.211815	NC_000860 Chordata  
 Salmoniformes  
 Actinopterygii

i want to arrange the data in this text file in a way that each line will concatenate the 3 lines after it , so that will be 1 line , i want all the lines to be treated in this way ,

is there any way to do this ?

thanks in advance

weblover
Junior Poster
141 posts since Feb 2009
Reputation Points: 10
Solved Threads: 1
 

both sed and (g)awk can handle this with reasonable ease.

griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: