deleting rows that have certain characters

Hi,

I want to delete rows whenever column one has the letters 'rpa'. The file is tab seperated.

e.g.

years   1
bears   1
cats     2
rpat     3
rpa99   4
rpa011  5

then removing 'rpa' containing rows based on the first column

years   1
bears   1
cats     2

thanks

from a file or from a list?

hello buddy,

awk '$1!~/rpa/' file 

Regards,
gaurav.

Base on OP example

awk '!/^rpa/' file

or

grep -v ^rpa file

I think the OP stated that he wants to remove the rows whenever column one contains rpa so gaurav1086 solution would do the requirement.:b:

awk '$1!~/rpa/' file

That's correct but I'll let the OP be the judge on that :wink:

ooop's sorry, i just saw the caret sign now.:eek:

Hello,

He wants to remove column which contains 'rpa' and not that start with 'rpa'
So

grep -v '^rpa' file

would rule out patterns
".+rpa.*" for example abcrpagen.

Apparently that kind of data is not mentioned but the statement says there is a possibiliy of those patterns.

Regards,
gaurav.