Guest User

Untitled

a guest
Nov 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import sys
  2.  
  3. output = ""
  4. fname = sys.argv[1]
  5. inputFile = open(fname, "r")
  6. lines = inputFile.readlines()
  7. for line in lines:
  8. print(line)
  9. if not (line in output):
  10. output += line
  11. inputFile.close
  12. outputFile = open("striped_"+fname, "w")
  13. outputFile.write(output)
  14. outputFile.close
  15.  
  16. # $ python remove_dup_line.py foo.txt
  17. # Output: striped_foo.txt
Add Comment
Please, Sign In to add comment