mirror of
https://github.com/bvanroll/odiseectf.git
synced 2025-08-29 03:42:41 +00:00
patterns shit
This commit is contained in:
21
patterns/removedupes.py
Normal file
21
patterns/removedupes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import sys, os
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("usage python removedupes.py FILE")
|
||||
sys.exit()
|
||||
lines = []
|
||||
f = sys.argv[1]
|
||||
with open(f, 'r') as infile:
|
||||
lines = infile.readlines()
|
||||
|
||||
|
||||
|
||||
outlines = []
|
||||
for l in lines:
|
||||
if l not in outlines:
|
||||
outlines.append(l)
|
||||
|
||||
|
||||
with open(f+".dupless", "w") as outfile:
|
||||
outfile.writelines(outlines)
|
||||
|
Reference in New Issue
Block a user