Category : re

I am working with Regex and currently I am trying to extract the Name, IFSC and Account No. from the PDF. I am using following code to extract the details. acc_name= " ", ‘n’.join([re.sub(r’^[d t]+|[d t]+:$’, ”, line) for line in data.splitlines() if ‘Mr. ‘ in line]) acc_no= " ", ‘n’.join([re.sub(r’Account Numbers+:’, ”, line) for ..

Read more

I’m trying to extract all text between certain characters but my current code simply returns an empty list. Each row has a long text string that looks like this: "[{‘index’: 0, ‘spent_transaction_hash’: ‘4b3e9741022d4’, ‘spent_output_index’: 68, ‘script_asm’: ‘3045022100e9e2280f5e6d965ced44’, ‘value’: Decimal(‘381094.000000000’)}n {‘index’: 1, ‘spent_transaction_hash’: ‘0cfbd8591a3423’, ‘spent_output_index’: 2, ‘script_asm’: ‘3045022100a’, ‘value’: Decimal(‘3790496.000000000’)}]" I just need the values for ..

Read more

I am scraping numbers from a webpage and appending them onto a Python list. The scraped strings take on the following forms: Millions: 1,000,000 1,000,000.9 1,000,000.99 1,000,000.999 Hundreds of thousands (same applies for tens of thousands and thousands): 100,000 100,000.9 100,000.99 100,000.999 Which means: trailing zeros are not displayed in the decimal places. My list ..

Read more