I have a .sql dump with html content in it. I want to remove a title="...." from <img...>
strings.
Tricky part is that these title="....." als appears in <href.....>
parts of a line.
To make it more visible I use the following strings in a 2 line file:
A B C D B C A B C
Y B C D B C Y B C
The B reprecents the title="...."
part and A....C
is the <img....>
part
The resulting file should look like
A C D B C A C
Y B C D B C Y B C
Only the B
should be removed within A...C
and the seccond line should be untouched
I'm using sed because I know this best but if somebody knows a better way I'm interested to know.
Till now I've used the following command
cat file |sed '/A/ s/B/X/g'
Problem is it also replaces the B
within D...C
A C D C A C
Y B C D B C Y B C
Any ideas would be appriciated.
regards,
Arjan
PS: Real life example, just one line:
nbsp;</p><p> <img src="images/vlaggen/dene_vlag.png" border="0" alt="Vlag van Denemarken" title="REMOVE THIS TITLE" width="75" height="50" align="left" /> <a href="images/hov.png" target="_blank" title="DONT REMOVE THIS TITLE"><img src="images/small.png" border="0" alt="Kaart van Denemarken" title="REMOVE THIS TITLE" align="right" /></a> <br /><br /> </p><p> </p><h1>Title of page</h1>