lines_seen = set() # holds lines already seen outfile = open("literatur_clean.txt", "w") for line in open("literatur_dupl.txt", "r"): if ('{' in line or '}' in line) or line not in lines_seen: outfile.write(line) lines_seen.add(line) outfile.close() -- http://mail.python.org/mailman/listinfo/python-list
- Delete duplicate rows in textfile - except it contains a &qu... Joon Ki Choi
- Re: Delete duplicate rows in textfile - except it conta... Mark Lawrence
- Re: Delete duplicate rows in textfile - except it conta... Peter Otten
- Re: Delete duplicate rows in textfile - except it conta... Dave Angel
- Re: Delete duplicate rows in textfile - except it c... Joon Ki Choi