Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transform two lines in one... 1

Status
Not open for further replies.

Diogo

Technical User
Mar 22, 2001
143
PT
Hi...

Is there any way that i could transform some lines in only one.

Ex.

Jonh Smith B 123
Jonh Smith E 456
Jonh Smith E 789
Denis Smith B 123
Denis Smith E 456

transform in
Jonh Smith 123 456
Jonh Smith 123 789
Denis Smith 123 456

Thanks any way...

DR

 
Something like this ?
awk '$3=="B"{n=$4;next}{print $1,$2,n,$4}' /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top