I want to replace a lines that ends with ‘YES’ with ‘YES’ and replace lines that ends with ‘NO’with ‘NO’. I have to apply for a large file.
Input:
max. C 13 0.457 0.32 YES max. Y 13 0.232 0.33 NO max. S 1 0.315 0.87 NO
Output:
YES NO NO
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.
If you want Y and N instead of YES and NO then change it to
To read more about perl regular expressions, substitions, etc. check out “perldoc perlre” from the command line of your system where perl is installed