Advertisement
konyakov

Deleting duplicate strings

Feb 18th, 2012
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #! /usr/bin/env python
  2.  
  3. input = open('in.txt', 'r')
  4. output = open('out.txt', 'w')
  5. linesarray = input.readlines()
  6. input.close()
  7. seen = []
  8. for i in range(len(linesarray)):
  9.     if seen.count(linesarray[i]) == 0:
  10.         seen.append(linesarray[i])
  11.         output.write(linesarray[i])
  12.  
  13. output.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement