Hello, I am facing the following problem.
Let's say I have a file, which contains something like this:
blah blah blah blah
more text
<tag1>something</tag1>
<tag2>something else</tag2>
blah blah meh whatever
foo bar
What I want to do is to replace all occurrences of tag1 with tag2, and all occurences of tag2 with tag1. However, I don't know how to do it, since if I'd use something like sed 's/tag1/tag2/g'
and then sed 's/tag2/tag1/g'
, I'd end up with a file with just tag1's.
What I need is to "flip" the two tags.
Thanks in advance.