I'm new in python. I have a log file with content like this:
[14:43:28]Toyota Camry/BH1488XO/service:complex/employee:Oleg/price:550
[15:56:15]Nissan Almera/BE0348CH/service:outside+interior/employee:Serega/price:450
[15:59:44]VW Amarok /BH138E/service:complex/employee:Oleg/price:700
[16:00:48]BMW X7/BH1155HH/service:2-phase complex+plastic /employee:Sasha/price:1400
[16:02:38]Jeep Renegade/BE6782IK/service:wash/employee:Serega/price:300
[16:03:19]MB C300/BT4500BT/service:complex/employee:Sasha/price:550
[16:04:19]MB C200/BT4400HT/service:complex/employee:Sasha/price:1000
I need to make a dict which will content an employees as a key and a sum of his prices like {"Oleg": 1250}
i used this code to make lis of employees:
with open ("17082022.log", "r") as file:
text = file.read()
emp_list = set(re.findall(r'employee:(.*)/', text))
and this to make list of prices
output_pluses = re.findall(r"(?<=price:)[+-]?\d+", text)