Hi all
i have a script from which i get the output (i also save this output to a file in f1 = 20141202.194812_carStatus/):
Code:
---------------------------------------------
TM 05120970.01: Processing...
TM 05120970: Processing...
TM 05120970: current status Paid
TM 05120970: Owner_Info.User_ref = crossi14
TM 05120970: Owner_Info.Email = Criss.Rossi@gmail.com
TM 05120970: CarModel = Nissan Micra
----------------------------------------------
TM 05157414.06: Processing...
TM 05157414: Processing...
TM 05157414: current status Open
TM 05157414: Owner_Info.User_ref = yumiao12
TM 05157414: Owner_Info.Email = Yu.Miao@gmail.com
TM 05157414: CarModel = Toyota Avensis
----------------------------------------------
i used: exec_cmd('cat ' + f1 + '| grep -e "CarModel = " -e "Owner_Info.User_ref = "')
but i also need the first line (actually the second) of the block
TM
05157414.06: Processing...
what i try/need to do is, parse and and get the values in a variable for each of this blocks:
TM 05120970.v1 -> car_number = 05120970.01
Owner_Info.User_ref = crossi14 -> owner_user = crossi14
CarModel = Nissan Micra -> car_model = Nissan Micra
with this information i will added some default things like:
priority = Unknown
and i will need to have this variables as input for another script called insert_owner_car.pl:
Code:
insert_owner_car.pl -id 05120970.v1 -o owner_user="crossi14",car_model="Nissan Micra",priority="Unknown"
i tried using splitlines and then split after " = ", but somehow i dont get what i want, is there some other way to do this?
i really need help!
thank you
PS: i only have python 2.5.1