Good afternoon, how to use the PythonRegEx module re in Excel data to get data from the example: #0000002947 _ _ 0 _ PK2/6700094735
only the last PK2/6700094735
, this means that it writes out/searches for the first PK and then writes out all the data that is on the right side.
My code
while ('__' in opis):
opis = opis.replace('__', '_',)
try:
order = opis.split('#')[1].split('_')[1]
except:
pass
if not order:
try:
order = opis.split('_')[-1]
except:
if df[i]['KAT FI'] == 'Kat ZKP':
order = re.findall("PK+\w", opis)
else:
order = ""