Using the following command I am able to parse strings except for some mismatch:
re.compile("(?P<Date>\d{2}[.-]\d{2}[.-]\d{4})\s(?P<Item_Name>.+)\s(?P<Transaction_Amount>[\d,\.\s\d]+)\s(?P<Balance>[\d,\.\s\d]+)")
If I apply this to a list of strings:
['07-10-2019 BIL/INFT/somenumbers/82D3/ AJAY KUMAR 6,080.00 2,46, 287.08',
'08.10.2019 MOBILE BANKING MMM TiMPS/somenumbers/ SIHDFC 4,411.00 250,698.08']
the output is
[{'Date': '07-10-2019', 'Item_Name': 'BIL/INFT/somenumbers/82D3/ AJAY KUMAR 6,080.00', 'Transaction_Amount': '2,46,', 'Balance': '287.08'},
{'Date': '08.10.2019', 'Item_Name': 'MOBILE BANKING MMM TiMPS/somenumbers/ SIHDFC', 'Transaction_Amount': '4,411.00', 'Balance': '250,698.08'}]
So, the second dictionary output is correct . In the first output, it seems due to an extra space in 2,46, 287.08, the number 6.080.00 is getting clubbed with Item_Name and Transaction_Amount , Balance is incorrect. Any way to rectify this?