I am having trouble getting the command right for replacing a series of characters between two tags with spaces with the aid of sed. The idea is the following:
Replace
Quote:
<TAG ONE>*****</TAG ONE>
<TAG TWO>**</TAG TWO>
<TAG ONE>********</TAG ONE>
<TAG THREE>*********************</TAG THREE>
<TAG ONE>*</TAG ONE>
|
with
Quote:
<TAG ONE>xxxxx</TAG ONE>
<TAG TWO>**</TAG TWO>
<TAG ONE>xxxxxxxx</TAG ONE>
<TAG THREE>*********************</TAG THREE>
<TAG ONE>x</TAG ONE>
|
that is replace each asterisk * between TAG ONE delimiters with one x (actually a space, but that is not visible in the QUOTE environment here at LQ.com), and leave the other * alone.
I have an HTML ASCII art file, which I would like to "convert" with sed to a simple text file that I could use in other areas without the tags. I'd have to remove all tags and add the appropriate new lines, but with sed that is a piece of cake. The only problem that remains is the "between-tags" thingy.
Thanks!