<tr><td width=10% style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>Package</b></td><td width=10% valign=center style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>JTs</b></td>
This is got to be simple. I run this on the above .html file:
sed 's/;background:#F7F0D9;padding:0in 0in 0in 0in 0in//' infile
but it won't work. What Monday, need more coffee, syntax am I missing?
Try putting a backslash in front of the semi-colons.
sed 's/\;background:#F7F0D9\;padding:0in 0in 0in 0in 0in//' infile
No Joy
sed 's/\;background\:#F7F0D9\;padding\:0in 0in 0in 0in 0in//' infile
No Joy
and
sed 's/\;background\:\#F7F0D9\;padding\:0in 0in 0in 0in 0in//' infile
No Joy
:wall:
What do you mean by doesn't work? Could you post the output you get and explain what the problem is?
I tried both the way I told you and with your superfluous blackslash in front of a colon. Both work for me.
$ cat f
<tr><td width=10% style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>Package</b></td><td width=10% valign=center style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>JTs</b></td>
$ sed 's/\;background:#F7F0D9\;padding\:0in 0in 0in 0in 0in//' f
<tr><td width=10% style='width:5%'><center><b>Package</b></td><td width=10% valign=center style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>JTs</b></td>
$ sed 's/\;background\:#F7F0D9\;padding\:0in 0in 0in 0in 0in//' f
<tr><td width=10% style='width:5%'><center><b>Package</b></td><td width=10% valign=center style='width:5%;background:#F7F0D9;padding:0in 0in 0in 0in 0in'><center><b>JTs</b></td>
$
I'm not kidding. It doesn't want to work. Other sed cmds are working.
I ran the cmd against the file and the output was still the same as the original. See attached JPG
A jpg file is not a very useful way to present the characters on your screen. I looked at the jpg and I did not see a single occurance of the sequence ";background" anywhere except your sed command. The sequence ";background" does appear in the data in your first post though. I copied and pasted that text to use as my test data. It works with that.
try this, might work:)
sed 's|;background:#F7F0D9;padding:0in 0in 0in 0in 0in||g'
Ok, I found it.
There are mixed formats in this file. It has Hundreds of background and padding calls. Some have extra spaces ie: padding: and padding :. So, my sed was working, but the results looked like they failed.
:wall:, that is why I'm cleaning these files!