I would like to delete the lines from text files if $4 is one
123 34 A 0
23 45 A 1
36 5 A 36
176 3 A 1
desired output
123 34 A 0
36 5 A 36
I need in-place editing. How can I do this with awk or sed?
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.
One way using
GNU sedwith-ifor in-place editing and-rfor extended regular expressions:If you desperately need in-place editing, you may also like to try
perlwith it’s auto-split functionality. The code is much more readable and portable too:Results: