import pandas as pd

masterDF = pd.read_csv('../input/emails.csv')

messageList = masterDF['message'].tolist()
bodyList = []
for message in messageList:
    firstSplit = message.split('X-FileName: ', 1)[1]
    secondSplit = firstSplit.split('.')
    if len(secondSplit) > 1:
        secondSplit = secondSplit[1]
    body = ''.join(secondSplit)[4:]
    bodyList.append(body)