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

extracting from a file the line after a constant

Status
Not open for further replies.

vergeb

MIS
Sep 22, 2003
8
US
Hello,
I've got a file that has records that have more than one line. These multi-line records are seperated by a series of dashes (-------) accross the page. ie:

----------------------------------------------------------
JOESMITH JOE SMITH 12 MAIN ST
BOSTON MA 9999999
999-999-999999
----------------------------------------------------------
I want to extract from the file the line after the line of dashes.
-Verge
 
How many records between two dash lines?

Try it:

sed -n '/^\-\-*/d;p' yourfile

tikual
 
Or using awk

/^--*$/ {flg=1}
flg{print;flg=0}



CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top