I have data in the following form:
<a> <b> _:h1 <c>.
_:h1 <e> "200"^^<http://www.w3.org/2001/XMLSchema#integer> <f> .
_:h1 <date> "Mon, 30 Apr 2012 07:01:51 GMT" <p> .
_:h1 <server> "Apache/2" <df> .
_:h1 <last-modified> "Sun, 25 Mar 2012 14:15:37 GMT" <hf> .
I need to convert it into the following form using Python:
<a> <b> _:h1.
<1> <c>.
_:h1 <e> "200"^^<http://www.w3.org/2001/XMLSchema#integer> .
<1> <f>.
_:h1 <date> "Mon, 30 Apr 2012 07:01:51 GMT".
<1> <p>.
_:h1 <server> "Apache/2" .
<1> <df>.
_:h1 <last-modified> "Sun, 25 Mar 2012 14:15:37 GMT" .
<1> <hf>.
I wrote code in Python which using the str.split()
method. It splits the string based on space. However, it does not solve my purpose as by using it "Sun, 25 Mar 2012 14:15:37 GMT" also gets split. Is there some other way to achieve this using Python?