Skip to content

Commit 687593f

Browse files
committed
Added removeDouble script
1 parent d4f2ba2 commit 687593f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ Option to keep only the header of the first file. (useful for csv files)
1818

1919
### semicolonToCommaSeperated.py
2020
Replaces all commas with a dot '.'
21-
Replaces all semicolons with a comma ','
21+
Replaces all semicolons with a comma ','
22+
23+
### removeDouble.py
24+
Takes a file with a list of words
25+
Removes all instances of words which occur more than once

removeDouble.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
############################################################
2+
# Takes a file with a list of words
3+
# Removes all instances of words which occur more than once
4+
############################################################
5+
6+
FILENAME = 'allmods.txt'
7+
OUTPUT = 'difference.txt'
8+
9+
adict = []
10+
diff = []
11+
12+
13+
file = open(FILENAME)
14+
15+
for item in file:
16+
adict.append(item)
17+
18+
for item in adict:
19+
if adict.count(item) ==1:
20+
diff.append(item)
21+
22+
outFile = open(OUTPUT,'w')
23+
outFile.writelines(diff)

0 commit comments

Comments
 (0)