In vi editor for search and replace , I used to use :%s/'thing-to-be-searched'/'replace-thing'/.
Now i came across this line :%s/^/##hello#/
Can someone help me decipher this line.
Thanks in advance.
Jack Frost wrote:Is there a way I can start search and replace at a specific line, without highlighting the text?From the page you linked::5,12s/foo/bar/g Change each 'foo' to 'bar' for all lines from line 5 to line 12 inclusive.
What is the proper way to replace a given string with another inside a log/text file by using python? I am currently reading the file line by line, and I'm using the regular expressions (re) module to see whether the string is present in that line.