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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenation

Status
Not open for further replies.

afender99

MIS
Dec 5, 2003
7
SG
hi guys,

i got this file with content as follow:

abc
123
def
456
lmn
789

my problem is how to reconstruct the content to be like the one shown below

abc 123
def 456
lmn 789


 
Try it:

sed -n "$!N;s/\(^.*\)\n\(.*$\)/\1 \2/p" yourfile

tikual
 
You could also have used paste...

paste -s -d' \n' file1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top