I have a perl script that will change specified text to a specified image on an html page. However if the text contains parenthesis or is on a line with such then it will just skip over it. Here is the line of code I use...
perl -pi.bak -e "s/>Admirals</><img src=\"pics\/admirals.gif\"></g" Rosters.html
perl -pi.bak -e "s/>Moose</><img src=\"pics\/moose.gif\"></g" Rosters.html
That WILL change the text of Admirals and Moose and replace all instances of it on Rosters.html with the specified image.
But, if a word resides in parenthesis on Rosters.html then it will just skip over it, not changing the text to an image.
So let's say the text on Rosters.html looked like this...
Admirals
Admirals
Admirals (Moose)
Admirlas
After running the script it will look like this...
admirals.gif
admirals.gif
Admirals (Moose) <--still both text
admirals.gif
Where as I want it to look like this...
admirals.gif
admirals.gif
admirals.gif (moose.gif)
admirals.gif
* please note I used the file name since you can't display images here
So I'm hoping someone could help me out with a solution to this. Thanks, I hope I was clear enough on my explanation.
Adaviel, thank you for your reply, however nothing has changed and it still comes out as...
admirals.gif
admirals.gif
Admirals (Moose) <--still both text
admirals.gif
perl -pi.bak -e "s/>Admirals</><img src=\"pics\/admirals.gif\"></g" Rosters.html
perl -pi.bak -e "s/>Moose</><img src=\"pics\/moose.gif\"></g" Rosters.html
That WILL change the text of Admirals and Moose and replace all instances of it on Rosters.html with the specified image.
But, if a word resides in parenthesis on Rosters.html then it will just skip over it, not changing the text to an image.
So let's say the text on Rosters.html looked like this...
Admirals
Admirals
Admirals (Moose)
Admirlas
After running the script it will look like this...
admirals.gif
admirals.gif
Admirals (Moose) <--still both text
admirals.gif
Where as I want it to look like this...
admirals.gif
admirals.gif
admirals.gif (moose.gif)
admirals.gif
* please note I used the file name since you can't display images here
So I'm hoping someone could help me out with a solution to this. Thanks, I hope I was clear enough on my explanation.
Adaviel, thank you for your reply, however nothing has changed and it still comes out as...
admirals.gif
admirals.gif
Admirals (Moose) <--still both text
admirals.gif