I am trying to comment out a matched string in a file and add new line right below the matched string. Is there any way to do this ? May be using sed or awk.
line1 is good line2 is bad line3 is to be commented line4 is final
I want to match line3 here (not using line number) and comment it out and add new line right below it.
line1 is good line2 is bad #line3 is to be commented new line line4 is final