Skip to content

Instantly share code, notes, and snippets.

@Alamin02
Created November 28, 2019 10:59
Show Gist options
  • Save Alamin02/149bb09c30efe9eb74701f9e175ca7b5 to your computer and use it in GitHub Desktop.
Save Alamin02/149bb09c30efe9eb74701f9e175ca7b5 to your computer and use it in GitHub Desktop.
import re
word_list = []
with open("text.txt", 'rt') as myfile:
for line in myfile:
matches = re.findall('\/\/(.+?)\#\#', line)
word_list = word_list + matches
with open("output.txt", 'w+') as outputfile:
for word in word_list:
outputfile.write("%s\r\n"% word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment