Mar-19-2020, 11:48 AM
Fixed it myself. Sometimes it
s so easy,but you simply are to blind and dont notice it
s already a Function availabledef changeprg(): a = 0 fc = 0 lc = 1 lst3=[] addstr="" with io.open("ud- "+sys.argv[1]+"fr.seq", encoding='ascii', errors='replace') as f: for line in f: addstr=line a +=1 lc +=1 if a == 4: # get numer of Files stored in this List fc = int(line) lc = 0 if lc ==5: # stop each 5th Line where PRG Filetype is stored, beginning with Line 9 in File addstr="" addstr=unicode(fc) + '\n' # toggle Value to unicode lc = 0 fc -=1 lst3.append(addstr) with io.open("ud- "+sys.argv[1]+"-fr-renumbered.seq", 'w', encoding='ascii', errors='replace', newline='\r') as f: for item in lst3: f.write(item)