To find out what was wrong with your sed - and awk -commands it would greatly help to post them. As a matter of fact my crystal ball is in repair right now, so you will have to post your code.
From what you have told us, this will achieve your output, but I would bet my house it isn't what you really want:-
echo "<tr><td>text </td> </tr>" > 123.txt
You need to tell us how/why a transformation is performed and what attempts your have made so far so we can try to understand your needs properly. Output/errors are very useful in diagnosing where it's not doing quite what you want, but you would need to show some meaningful input & desired output before we can be sure we are going in the right direction.