Skip to content

Instantly share code, notes, and snippets.

@piyh
Last active March 31, 2020 17:27
Show Gist options
  • Save piyh/72e1abafe70ad433203348cdf10ad1e0 to your computer and use it in GitHub Desktop.
Save piyh/72e1abafe70ad433203348cdf10ad1e0 to your computer and use it in GitHub Desktop.
#word_list = ['hello','there','general','kenobi']
#word = ['hello','there']
import os, os.path as path
os.chdir("E:\\kingcobrajfs")
wordList =[]
with open('wordlist_remove.txt', 'r') as words:
for line in words:
wordList.append(line.strip())
with open('workfile', 'r') as inbound:
readFile = ""
for line in inbound:
readFile = readFile + ' ' + line.strip() + ' \n \n'
with open('workfileProcessed', 'w') as outbound:
outbound.write(' \n'.join([i for i in readFile.split() if i not in wordList]))
print('done')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment