You're viewing a comment by Jon marsch and its responses.

Jon marsch Permalink
November 29, 2012, 00:01

I have the following lines
Point
x
y
z
delay
a
b
delay
awk '/Point/,/delay/{print $0}' file.xt seems to include the second delay. How do i stop with the first one?. Thanks

Comment Responses

July 05, 2013, 18:00

This is discussed in the Awk Tips Tricks and Pitfalls article.

In general, here's how:

awk '/beginpat/,/endpat/{if (!/beginpat/&&!/endpat/)print}'

In your case:

awk '/Point/,/delay/{if (!/Point/&&!/delay/)print}'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.