I am trying to delete comments from a file, the comments start with "#" symbol. I am able to remove comments that starts the line with '#' but there are some comments in the file that are starting in between the line. Is there any method to remove comments like that.?
Here is the sample code.
# modified code
begin
stuff
stuff
end # ended module
I want to delete the text followed by # in line 5.