logg = 'c:\\tmp\\Logg\\12-12-13.txt' f=open(logg,'r') file = f.readlines() f.close Data={} feltypen=() for line in open(logg): if len(line)>142: grab= (line) #dörrpanel sekvens = grab[31:38] #last layer put in list model= grab[39:47] #this is toplayer feltyp= grab[161:] #sorted under the toplayer if model in Data: if feltyp in Data[model]: try: (feltyp).append(sekvens) except: (feltyp)=() (feltyp).append(sekvens) else: Data[model].append(feltyp) feltyp)=() (feltyp).append(sekvens)
I know my syntax is messed up, but I cant find a way to write this code to get it to work. thanks for all help