From: RichGlazier@netscape.net (Rich Glazier)
Subject: inserting a blank line in a file
Date: Tue, 21 Oct 2003 17:13:21 -0400 [thread overview]
Message-ID: <3FD452FC.55839A6D.3ED58B64@netscape.net> (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
reply other threads:[~2003-10-21 21:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox