I write down the list in csv. Source Lists: 
What am I doing wrong? and why only 1 list is added to the file?
def add_line_in_csv(line): with open(file_output, "w", newline="") as file: writer = csv.writer(file) writer.writerows(line) for file in list_file: my_file=open(file,"r") if file==list_file[0]: for i, line in enumerate(my_file): if i==23: text=line[:-2] text = ' '.join(text.split()) text=text.split(" ") print(text) add_line_in_csv(text) for i, line in enumerate(my_file): if i > 23: text = ' '.join(line.split()) text=text.split(" ") print(text) add_line_in_csv(text) 