I have a file in which i want replace last occurrence of string in third to the last line in a file. I have a file like:
analyze_compression_testpoints -log no -TESTMODE FULLSCAN -EXPERIMENT <br /> azul_rrfa -outputfile ./testresults/testinsertion.file<br /> </body> </html>
I want to replace
<br /> with
</font> in the third last line only.
I am using:
sed -i "s|\(.*\)<br />\$|\1</font>|g"
but it is replacing all the last occurrence in each line, but i want only last occurrence of file, not each line.