Created
May 11, 2023 16:50
-
-
Save tharmann/c263568615eb3ff6e8497bd63e75873f to your computer and use it in GitHub Desktop.
wc-prod-ex-csv-reader.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('wc-product-export-10-5-2023-1683750652005 - wc-product-export-10-5-2023-1683750652005.csv') as csv_file: | |
csv_reader = csv.reader(csv_file, delimiter=',') | |
line_count = 0 | |
for row in csv_reader: | |
if line_count == 0: | |
line_count += 1 | |
else: | |
col_count = 0 | |
for column in row: | |
if column == 'Genus Species': | |
scientific_name = col_count + 1 | |
print(row[0] + ',' + '"' + row[scientific_name] + '"') | |
col_count += 1 | |
line_count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment