'Iterate through the data and add redirects to output.txt file, appending to file as necessary.'

def create_redirect(self):

    with open('output.txt', 'a') as output_file:
        for data_element in self.data:
            if data_element.get('function'):
                name = data_element.get('function').encode('utf-8')
                abstract = data_element.get('abstract').encode('utf-8')
                url = data_element.get('url').encode('utf-8')
                list_of_data = [(name + '    function'), 'R', name, '', '', '', '', '', '', '', '', '', '']
                line = ' DCTB '.join(list_of_data)
                output_file.write((line + '\n'))
