Reputation: 683
I'd like to make AWK only print lines that don't match the following pattern:
awk -F'-' 'NF>7'
(lines in which - appears more than 7times)
Is there a simple way to do this?
Thank you very much
Upvotes: 0
Views: 1462
Reputation: 204638
Stick a !
in front of it or change the comparison from >
to <=
.
Upvotes: 3
Reputation: 951
If you're not tied to using Awk, GNU Grep can do it: Code:
grep -Ev '<your regex>'
The -v option means show lines that don't match, -E means use extended regular expressions
Upvotes: 0