Jan-07-2020, 08:22 AM
Just playing with string .split method . It assumes that needed part is between first and last underscore (as provided in example).
>>> s = '20191210.092030_Monthly_Service_Cost_12-10-2019-02-17' >>> f"{''.join(s.split('_', maxsplit=1)[1].rsplit('_', maxsplit=1)[0].split('_'))}.zip" 'MonthlyServiceCost.zip'
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.