Skip to content

Instantly share code, notes, and snippets.

@optimumtact
Created February 28, 2021 06:13
Show Gist options
  • Save optimumtact/c4086c600712eff0046fe72aca5e23b8 to your computer and use it in GitHub Desktop.
Save optimumtact/c4086c600712eff0046fe72aca5e23b8 to your computer and use it in GitHub Desktop.
inputfilename = input('Enter name of input file to be read (Should be a csv): ')
outputfilename = input('Enter name of output file (Outputs a .txt file): ')
#Loading entire contents from file into a list. List is formatted like [Location, word phrase, location, word phrase]
file = open((inputfilename) , 'r')
ofile = open((outputfilename) , 'w')
for line in file:
line = line.strip().split('-')
string = "{1} <a href=\"{0}\" target=\"_blank\">Candidate thread</a>\n".format(line[1], line[0])
ofile.write(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment