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
curleb
2
from a file or from a list?
I think the OP stated that he wants to remove the rows whenever column one contains rpa so gaurav1086 solution would do the requirement.
awk '$1!~/rpa/' file
That's correct but I'll let the OP be the judge on that
ooop's sorry, i just saw the caret sign now.
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.