I have data in the following format:
Input Data:
#@ <id_1d3s2ia_p3m_zkjp59>
<Eckhard_Christian> <hasGender> <ma<>le> .
#@ <id_1jmz109_1gi_t71dyx>
<Peter_Pinn<>e> <created> <In_Your_Arms_(Love_song_from_"Neighbours")> .
#@ <id_v9bcjt_ice_fraki6>
<Blanchester,_Ohio> <hasWebsite> <http://www.blanchester.com/> .
#@ <id_10tunwc_p3m_zkjp59>
<Hub_(bassi~st)> <hasGender> <ma??le> .
Output Data:
<Eckhard_Christian> <hasGender> <male> <id_1d3s2ia_p3m_zkjp59>.
<Peter_Pinne> <created> <In_Your_Arms_(Love_song_from_"Neighbours")> <id_1jmz109_1gi_t71dyx>.
<Blanchester,_Ohio> <hasWebsite> <http://www.blanchester.com/> <id_v9bcjt_ice_fraki6>.
<Hub_(bassist)> <hasGender> <male> <id_10tunwc_p3m_zkjp59>.
That is in the output data I want to delete all other characters except: alphanumeric and :,/,/,.,_,(,) between any two starting and ending < >. I know python allows me to split using string.split() but if I split using < > as demarkers then for <ma<>le> I get (<ma,<>,le>).
Is there some other way by which I may split in python so that I may get the data in the desired form. Also I want preceding lines < > (following # @) to appear as the last column.