Skip to content

Commit

Permalink
Merge pull request #23 from trots/Del_exp_column_csv
Browse files Browse the repository at this point in the history
Delete csv column
  • Loading branch information
trofim4ik authored Jun 3, 2024
2 parents 9686d93 + b06b073 commit afbdd1c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions youtube-analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,20 @@ def _on_export_csv(self):

with open(file_name[0], 'w', newline='', encoding='utf-8') as csvfile:
csv_writer = csv.writer(csvfile, delimiter=';')
csv_writer.writerow(self._model.header)
for result_item in self._model.result:
csv_writer.writerow(result_item)

header_csv = []
for column in range(len(self._model.header)):
if not exception_column(column):
header_csv.append(self._model.header[column])
csv_writer.writerow(header_csv)

result_csv = []
for row in range(len(self._model.result)):
for column in range(len(self._model.header)):
if not exception_column(column):
result_csv.append(self._model.result[row][column])
csv_writer.writerow(result_csv)
result_csv.clear()

def _on_export_html(self):
if self._request_text == "" or len(self._model.result) == 0:
Expand Down

0 comments on commit afbdd1c

Please sign in to comment.