Computing.Net > Forums > Unix > convert text rows to columns awk

convert text rows to columns awk

Reply to Message Icon

Original Message
Name: john smith123
Date: April 16, 2006 at 18:02:58 Pacific
Subject: convert text rows to columns awk
OS: solaris 2.8
CPU/Ram: 400mhz/500MB
Comment:

Hi,

I have a text file with the data in rows the data file has specfic pattern of rows I need to convert first 3 lines of rows into columns by doing a pattern search below is an example it would be appreciated I need to use shell script awk sed to this.

data file.txt INPUT
---------------

1 john smith I am new to unix
12345/00
x:134 y:23
2 john smith I am new to unix
12345/00
x:134 y:23
3 john smith I am new to unix
12345/00
x:134 y:23
4 john smith I am new to unix
12345/00
x:134 y:23
5 john smith I am new to unix
12345/00
x:134 y:23
----------
above is the line pattern I want the first started by 1 output to look like this


OUTPUT:
john smith i am new to etc. 12345/00 x:13y:23
I would appreciate it if someone can help me out with this small problem. I got far as using awk input field seperate by new line \n and was able to print 3 lines but not in a column format.


Report Offensive Message For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: convert text rows to columns awk 

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software