Apr-14-2019, 04:06 PM
Dear All,
I've not been using Python for years (I'm rather a matlab user), But I've the opportunity to work with it again.
The goal is to deal with Ascii files, containing different types of data; I'm wondering how to improve the code here after in order to record specific numbers between quotes, especially can I avoid (hugly) loop use?
Thanks for any advice
Paul
I've not been using Python for years (I'm rather a matlab user), But I've the opportunity to work with it again.

The goal is to deal with Ascii files, containing different types of data; I'm wondering how to improve the code here after in order to record specific numbers between quotes, especially can I avoid (hugly) loop use?
Thanks for any advice
Paul
t0 = time.time() line1 = '"tel 555-669", "duration 6", "number 2.", "Price 3.58"' quote = re.finditer('"',line1) position_quote = [] for match_quote in quote: position_quote.append(match_quote.span()) Price = float(line1[position_quote[6][0]+7 : position_quote[7][0]-1]) t1 = time.time() print("Duration : ", t1-t0)