woensdag 16 september 2009

Simpel uniq-script

infile = open(raw_input("Bestand: "), "r")
bestand = infile.readlines()
infile.close()

data = []

for line in bestand:
     if line not in data:
     data.append(line)

output = open(raw_input("Output: "), "w")

for regel in data:
    output.write(regel)
    output.close()

Geen opmerkingen:

Een reactie posten