I have a string given as:
text = """'select \\"ORDER_ID\\",\\r\\n \\"LINE_ID\\",\\r\\n \\"PRODUCT_ID\\",\\r\\n \\"CUSTOMER_ID\\",\\r\\n \\"PAYMENT_METHOD\\",\\r\\n \\"STATUS\\",\\r\\n \\"DATETIME_ORDER_PLACED\\",\\r\\n \\"DATETIME_ORDER_SHIPPED\\",\\r\\n \\"ORDER_QTY\\",\\r\\n \\"ORDER_AMOUNT\\",\\r\\n \\"ORDER_COST\\",\\r\\n \\"ORDER_VAT\\",\\r\\n \\"SHIPPING_COSR\\"\\r\\nfrom \\"DEMO\\".\\"DEMO\\".\\"ORDERS\\""
I am trying to clean this using below code:
text = text.replace("\\", '').replace('"', '')
I got the following result:
'select ORDER_ID,rn LINE_ID,rn PRODUCT_ID,rn CUSTOMER_ID,rn PAYMENT_METHOD,rn STATUS,rn DATETIME_ORDER_PLACED,rn DATETIME_ORDER_SHIPPED,rn ORDER_QTY,rn ORDER_AMOUNT,rn ORDER_COST,rn ORDER_VAT,rn SHIPPING_COSRrnfrom DEMO.DEMO.ORDERS
I cannot figure out why I am getting rn with every word. How I can get rid of this ? I even tried using text = text.strip('\r\n') but it is not working.