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

How to join 2 lines ??? 1

Status
Not open for further replies.

KevinMcKloud

Programmer
Jun 8, 2002
22
MX
hola, i've tried lots of stuffs to join two lines,
i know its very simple but im stuck in it... =/

input:

=======================
# uno dos tres
Clave cuatro cinco seis
siete
ocho
=======================
# uno dox trex cuatroo
Clave cincoo seix
siete 7
ocho 8
=======================

output:

=======================
# uno dos tres Clave cuatro cinco seis
siete
ocho
=======================
# uno dox trex cuatroo Clave cincoo seix
siete 7
ocho 8
=======================

see?, easy, I just want to join the line that
begins with "Clave" at the end of the previous
one that begins with "#" in a ms-dos environment
using awk, grep or sed.

Do I delete the EndOfLine of "#" line or do I
put both lines in variables and then join them, or what?

thanks for your help >=]

kevin
 
Amazing!.. Gracias vgersh99 =)

just a question, what is the function of the "1" ?
 
'1' evaluates to 'true' which in 'awk lingo' means 'print'

vlad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top