I want to delete a line if it contains a value that is specified.
2 5 8
1 3 7
8 5 9
So if I wanted to delete a line containing 7 as the third field:
{
if($3 == 7){
####delete the line
}
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It should be enough to say
Note that this a numerical comparison, and will omit lines in which the third field is, for example, “0.7e1”, but it will work for the sample data you provide.