1) There are one or more than one <tr> tags in same line.
2) Some tr tags may have one <td> or more tna one <td> tags within it.
3) Few <td> tags having "<td> � </td>". Few having more than one "�" entry in it.
Expected Output file:
I want to remove the multiple "�" entry if exists within <td> and want to display only one "�" entry like <td> � </td> like below.
-e is redundant here. If your SED supports extended regexps:
$ echo "� � � a � � �" | sed -r 's/(� *)+/\�/g'
�a �
$
The ( ) brackets group a whole section, after which is a + for "one or more repeats of this expression".
The & has to be escaped in the output expression as \&, otherwise & has the special meaning "the entire matched expression" which would end up adding MORE �
Question though: If specific numbers of non-breaking spaces aren't meant to be there, are any non-breaking spaces meant to be there? Why not replace them entirely with non-breaking spaces?
You could also try the following, which, other than copying the 1st line of your sample input file unchanged to the output, seems to create the output you said you want (and I don't understand from your description why the 1st line should not be copied unchanged):