tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* inserting a blank line in a file
@ 2003-10-21 21:13 Rich Glazier
  0 siblings, 0 replies; only message in thread
From: Rich Glazier @ 2003-10-21 21:13 UTC (permalink / raw)


Tru64 5.1A PK5

Does anybody know how to insert a blank line above a specific occurance in a file, without using vi?  As in the example file below, I want to insert a balnk line above every occurance of a line starting (or containing) "hello". I tried different itterations of tr, or sed, but most utilities deal with "lines following", not "lines prior".  

change:

hello there
tru64 managers
my name is rich
glazier 1234 1234
hello there
tru64 managers
my name is rich
glazier1 12345 12345
hello there
tru64 managers
my name is rich
glazier2 12346 12346

to:


hello there
tru64 managers
my name is rich
glazier 1234 1234

hello there
tru64 managers
my name is rich
glazier1 12345 12345

hello there
tru64 managers
my name is rich
glazier2 12346 12346


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-21 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-21 21:13 inserting a blank line in a file Rich Glazier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox