Created
November 4, 2020 23:42
-
-
Save chadfurman/d196bc9318fbe1215d83d90efda0be55 to your computer and use it in GitHub Desktop.
This file contains 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 | |
def csv_reader(filename: str, operation: callable) -> None: | |
with open(filename,'rt') as f: | |
data = csv.reader(f) | |
for row in data: | |
counter += 1 | |
if counter < 1: | |
continue # skip first row, it's a header | |
operation(row) | |
def process_row(row): | |
print(row[0]) # first column | |
print(row[1]) # second column | |
helpers.csv_reader('./local_file.csv', process_row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment