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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

convert text rows to columns awk

Reply to Message Icon

Name: john smith123
Date: April 16, 2006 at 18:02:58 Pacific
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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: convert text rows to columns awk

displaying words in a row to column www.computing.net/answers/unix/displaying-words-in-a-row-to-column/4945.html

How to convert text file to html www.computing.net/answers/unix/how-to-convert-text-file-to-html/4709.html

Convert a delimited text file to excel www.computing.net/answers/unix/convert-a-delimited-text-file-to-excel/2912.html