Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- output = ""
- fname = sys.argv[1]
- inputFile = open(fname, "r")
- lines = inputFile.readlines()
- for line in lines:
- print(line)
- if not (line in output):
- output += line
- inputFile.close
- outputFile = open("striped_"+fname, "w")
- outputFile.write(output)
- outputFile.close
- # $ python remove_dup_line.py foo.txt
- # Output: striped_foo.txt
Add Comment
Please, Sign In to add comment