'Iterate through the data and create the needed output.txt file, appending to file as necessary.'

def create_file(self):

    for data_element in self.data:
        title = data_element.get('title')
        abstract = self.truncate(data_element.get('first_paragraph'), 400)
        example = data_element.get('example')
        if example:
            abstract = '{}<br>{}'.format(abstract, example)
        abstract = abstract.replace('\n', '\\n')
        anchor = data_element.get('anchor')
        list_of_data = [title, 'A', '', '', '', '', '', '', URL_ROOT, '', '', abstract, anchor]
        self.output_file.write('{}\n'.format(' DCTB '.join(list_of_data)))
