Skip to main content
added 4 characters in body
Source Link

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file
c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file

Output:

<asd>-some stuff
-other stuff
final stuff.</asd>
<dsa></dsa>

Fetch the contents between 'dsa' tags:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"

Insert the content into 'asd' tags:

sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#"

Change 'dsa' tags and content to just <dsa></dsa>

'\#<dsa>#,\#</dsa>#c<dsa></dsa>'

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file

Output:

<asd>-some stuff
-other stuff
final stuff.</asd>
<dsa></dsa>

Fetch the contents between 'dsa' tags:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"

Insert the content into 'asd' tags:

sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#"

Change 'dsa' tags and content to just <dsa></dsa>

'\#<dsa>#,\#</dsa>#c<dsa></dsa>'

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file

Output:

<asd>-some stuff
-other stuff
final stuff.</asd>
<dsa></dsa>

Fetch the contents between 'dsa' tags:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"

Insert the content into 'asd' tags:

sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#"

Change 'dsa' tags and content to just <dsa></dsa>

'\#<dsa>#,\#</dsa>#c<dsa></dsa>'
Post Undeleted by schrodingerscatcuriosity
added 122 characters in body
Source Link

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file

Output:

<asd>-some stuff
-other stuff
final stuff.</asd>
<dsa></dsa>

Fetch the contents between 'dsa' tags:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"

Insert the content into 'asd' tags:

sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" file

Change 'dsa' tags and content to just <dsa></dsa>

'\#<dsa>#,\#</dsa>#c<dsa></dsa>'

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file
sed "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" file

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" -e '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file

Output:

<asd>-some stuff
-other stuff
final stuff.</asd>
<dsa></dsa>

Fetch the contents between 'dsa' tags:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"

Insert the content into 'asd' tags:

sed -e "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#"

Change 'dsa' tags and content to just <dsa></dsa>

'\#<dsa>#,\#</dsa>#c<dsa></dsa>'
added 122 characters in body
Source Link

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#s#dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file
sed "s#<asd>.*#<dsa><*</dsa>#;1q'asd>#<asd>${c//$'\n'/\\n}</asd>#" file

You can try this:

sed '\#<dsa>#,\#</dsa>#s#.*#<dsa></dsa>#;1q' file

You can try this:

c="$(sed -n '\#<dsa>#,\#</dsa>#p' file | sed 's#<dsa>\|</dsa>##')"
sed '\#<dsa>#,\#</dsa>#c<dsa></dsa>' file
sed "s#<asd>.*</asd>#<asd>${c//$'\n'/\\n}</asd>#" file
Post Deleted by schrodingerscatcuriosity
Source Link
Loading