Jay Taylor's notes

back to listing index

Printing all contents EXCEPT matching range pattern using awk - Stack Overflow

[web search]
Original source (stackoverflow.com)
Tags: programming regular-expressions patterns awk stackoverflow.com
Clipped on: 2013-09-24

In Awk, the range pattern is not an expression, so canot use the "!" to not it.so how to implement it (Printing all contents EXCEPT matching range pattern using awk)?

e.g.

$cat 1.t

abdhfdh#  fafadeafa123 #end

the result I wanted:

cat 1.t

abdhfdhend

EDIT:

I gave an impertinent example. the endpattern should be different with the startpattern because I just have not test this. That's My fault.

At the same time, I want to operate the range pattern and the not range pattern differently. So sed is not my choice.

asked Apr 11 at 16:24
Image (Asset 1/4) alt=