awk remove entire line if field contains string

This will remove the entire line if field 2 contains Apr

awk '$2 !~ /Apr/' Out > Out.temp && rm -f Out && mv Out.temp Out

This will remove the entire line if it begins with Apr.

sed -i '/^Apr./d' OutGoingFiles.txt

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.