I have a text file with about 200 lines. I need to search for a particular word "testing" and then add a character ":" at the end of those lines containing that word
This is an alternative in case (a) the last line is nonempty and (b) containing "testing" and (c) still want a colon be inserted.
[tt] 's/(\n|$)/:\1/ if/testing/'[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.