I have a text in every cell of a column, where i want to get some information from. In every cell i have detailed information about cars and i need to get the text from it. In my case these are the fuel and the CO2 information.
The string, that i get, looks like this:
cell 1 = 17.160 km, 80 kW (109 PS)Limousine, Autogas (LPG), Automatik, HU Neu, 2/3 Türenca. 5,0 l/100km (komb.), ca. 116 g CO₂/km (komb.)
cell 2 = EZ 10/2018, 12.900 km, 80 kW (109 PS)Limousine, Unfallfrei, Hybrid (Benzin/Elektro), Halbautomatik, HU Neu, ca. 5,9 l/100km (komb.), ca. 134 g CO₂/km (komb.) ... and so on
so i need the information from cell 1: 5,0 l/100 km and 116 g CO2/km
and from cell 2: 5,9 l/100km and 134 g CO2/km
I tried the following code examples, but nothing worked:
pattern_z = re.compile("[a-z]+.?\s?[0-9]+\s?[a-z]?\s[A-Z]+")
pattern_z = re.compile("^[ac]+\s?[CO]$")
pattern_z = re.compile(r'[0-9]+.[g]?')
and after each "pattern_z" variable i tried
co = pattern_z.search(i)
cox = co.group()
but nothing worked.
I would appreciate every help.