unstructured = open("UnstructuredEmotionRankings.txt", "r")
structured = open("EmotionRankings.txt", "w+")

currentWord = ""

for line in unstructured:
    thisLine = line.split()
    print(thisLine)
    thisWord = thisLine[0]
    if (thisWord == currentWord):
        structured.write("," + thisLine[2])
    else:
        currentWord = thisWord
        structured.write("\n" + thisWord + "," + thisLine[2])

unstructured.close()
structured.close()

81d8b7b548f6e60506aeadd91c8534bbd93742f0
<mask token>

<mask token>
for line in unstructured:
    thisLine = line.split()
    print(thisLine)
    thisWord = thisLine[0]
    if thisWord == currentWord:
        structured.write(',' + thisLine[2])
    else:
        currentWord = thisWord
        structured.write('\n' + thisWord + ',' + thisLine[2])
unstructured.close()
structured.close()

unstructured = open('UnstructuredEmotionRankings.txt', 'r')
structured = open('EmotionRankings.txt', 'w+')
currentWord = ''
for line in unstructured:
    thisLine = line.split()
    print(thisLine)
    thisWord = thisLine[0]
    if thisWord == currentWord:
        structured.write(',' + thisLine[2])
    else:
        currentWord = thisWord
        structured.write('\n' + thisWord + ',' + thisLine[2])
unstructured.close()
structured.close()

unstructured = open("UnstructuredEmotionRankings.txt", "r")
structured = open("EmotionRankings.txt", "w+")

currentWord = ""

for line in unstructured:
    thisLine = line.split()
    print(thisLine)
    thisWord = thisLine[0]
    if (thisWord == currentWord):
        structured.write("," + thisLine[2])
    else:
        currentWord = thisWord
        structured.write("\n" + thisWord + "," + thisLine[2])

unstructured.close()
structured.close()
