from solar import * ORI = str_to_datetime("2015-06-22T11:33:17.500363") def filter_log (filename): for line in open (filename): line = line.rstrip() if line.startswith(" "): str = line.split ()[1] dt = str_to_datetime (str) if dt < ORI: continue offset = (dt - ORI).total_seconds() % 100 #print (str, offset) if offset < 0.5 or offset > 99.5: print (line) filter_log ("solo_L1_swa-pas-3d_20150622_V01.log")