I have text as in below in a text file. All in one line
I want to read text between tags and print it nd I want to print it in multiple lines by breaking at '~', like below. How can I do that in python
Line 1- This is the data you requested~
Line 2- Use this data for processing~
Line 3 - If processing fails contact us @ 188-500-5678~
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header/><env:Body><re:EnvelopeResponse xmlns:core="http://www.AAAA.org/SOAP/SDL/Rule21.1.0.xsd"><PayloadType>Response</PayloadType><ProcessingMode>R</ProcessingMode><PayloadID>42eaf653</PayloadID><TimeStamp>2021-06-01</TimeStamp><SenderID>X</SenderID><ReceiverID>X</ReceiverID><RuleVersion>1.1.0</RuleVersion><Payload>This is the data you requested~Use this data for processing~If processing fails contact us @ 188-500-5678~</Payload><ErrorCode>Success</ErrorCode><ErrorMessage/></R:EnvelopeResponse></env:Body></env:Envelope>