removed NameError catch in file_to_txt