Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- incoming_file = input() + '.csv'
- exiting_file = input() + '.csv'
- with open(incoming_file, encoding='utf-8') as r_file:
- # Создаем объект reader, указываем символ-разделитель ","
- file_reader = csv.reader(r_file, delimiter = ":")
- # Счетчик для подсчета количества строк и вывода заголовков столбцов
- coun, zag, notes = 0, file_reader[0], []
- # Считывание данных из CSV файла
- for row in file_reader:
- if count != 0:
- notes += [row.split(',')[:-1] + row.split(',')[-1].split()[0]]
- zag += [row.split(',')[-1].split()[1:]]
- count += 1
- zag = zag.extend(notes)
- file_writer = csv.writer(exiting_file, delimiter = ",", lineterminator="\r")
- file_writer.writerow(zag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement