Jun-01-2021, 10:28 AM
You can also use:
Or, if you prefer a dictionary, use:
with open("C:\\temp\LongPctls.csv") as fp: crdr = csv.reader(fp) # can add optional [inline]delimiter='.'[/inline] if not comma (replace . with delimiter) for row in crdr: print(f"type row: {type(row)}, row: {row}"Using this method , if there is a header, it will be the first row
Or, if you prefer a dictionary, use:
with open("C:\\temp\LongPctls.csv") as fp: crdr = csv.DictReader(fp) # can add optional [inline]delimiter='.'[/inline] if not comma (replace . with delimiter) for row in crdr: print(f"type row: {type(row)}, row: {row}"Each row will be a dictionary.