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!

Inserting a line After finding a line with a specific word

Status
Not open for further replies.

KevinMcKloud

Programmer
Jun 8, 2002
22
MX
Hola =) ...

I have this:

hola eeeeeeeeeeeeeee eeee
seis siete ocho nueve
diez once doce trece catorce
hola aaaaaaaaaaaaaa aaaaaaaaaa
diez once quince veinte
hola bbbbbbbbbbbbbb
me oyen hola si bueno si probando

and I want this:

==================================
hola eeeeeeeeeeeeeee eeee
==================================
seis siete ocho nueve
diez once doce trece catorce
hola aaaaaaaaaaaaaa aaaaaaaaaa
==================================
diez once quince veinte
hola bbbbbbbbbbbbbb
==================================
me oyen hola si bueno si probando
hola siiiiiiiiiiii ya salio, jeje
==================================

So, how do I insert the "======" line
after a search for "hola" word, so
that way i can make 'groups' of info
to manipulate later...
(Also to insert a "=====" at the beginning
of the file, just for the 1st group)

Thanks =]

Kevin
 
NR == 1 { print "==============" }
{print }

/hola/ { print "==============" }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top