I have data in the following format:
This is line1 <line 1>.
This is line2 <http://<line2> .
This is line3 <http://<>line3>.
This is line4 <line4> .
I want to transform this data into the following format:
#@ <line 1>
This is line1.
#@ <http://<line2>
This is line2.
#@ <<http://<>line3>
This is line3.
#@ <line4>
This is line4.
I tried in python by splitting at < but it does not solve my purpose as '<' and '>' are present within strings themselves. Is there any way in python or linux(sed, etc) by which I may achieve the above given transformation