I have the following strings:
'10000 ABC = 1 DEF'
'1 AM = 0,30$'
'3500 ABC = 1 GTY'
'1000 HUYT=1ABC'
'1 MONET Data = 1 ABC'
I want to find a flexible way to extract numeric and string values from left and right sides of =. I do not know all possible string values. Therefore I cannot pre-define them. The only thing that I know is that left and right sides are divided by =.
The goal is to get this result for the above-given example:
String-pairs:
ABC-DEF
AM-$
ABC-GTY
HUYT-ABC
MONET Data-ABC
Numeric-pairs:
10000-1
1-0.30
3500-1
1000-1
1-1
I was trying to use .lstrip('...') and rstrip("..."), but it does not give me the expected result.
'1 MONET Data = 1 ABC'result in'MONET Data-ABC'and not'MONETData-ABC'when getting the string pair?