Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Usage of grep or awk

Status
Not open for further replies.

matt1

Mechanical
Sep 3, 2002
1
0
0
US
How would I grep for the pattern

"S T R E S S 1" from a file
and print the lines following the pattern etc upto to a blank line or

another pattern say "S T R E S S 5"

In other words print the lines between patterns
"S T R E S S 1" and " S T R E S S 5"

The File is as follows

S T R E S S 1
xyc
yzn nn
bx ccc-next line is a blank line

S T R E S S 5
ccc

ddfdsa


ddd

EOF

How would I use awk or any other pattern matching
utilities within UNIX to do this

Thanks

 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top