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

extarcting certain RE after a line containing another RE

Status
Not open for further replies.

moniema

IS-IT--Management
Apr 20, 2003
19
0
0
SD
Hello

All

1) I have a file like


PROFILE ....etc
....... sd04-418
....... sd04-430
EOD
PROFILE ....etc
....... sd04-418
....... sd04-430
EOD
PROFILE ....etc
....... sd04-418
....... sd04-430
EOD

the lines like ....... sd04-418 are many I need to print the line containing PROFILE ..... etc and all the lines containing ....... sd04-418 after it until EOD using sed



regards
 
Can you please post some detailed different input examples and expected result ?
I guess that awk is better suited than sed for your issue.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top