2

Input:

apple
orang3
123rat
ratty
123
app7e

Output:

apple
ratty

I am trying awk '$1 ~/[[:alpha:]]/' file but this only removes cases like 123 that are fully numerical but I also want app7e and orang3 to be removed.

3

To namely fit the condition "contain no numbers":

Simple grep approach:

grep -v '[0-9]' file

Or the same with awk command:

awk '!/[0-9]/' file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy