Skip to content

Instantly share code, notes, and snippets.

@grubberr
Created September 1, 2023 12:50
Show Gist options
  • Save grubberr/d3797e29c34977187300b33e638c4dbf to your computer and use it in GitHub Desktop.
Save grubberr/d3797e29c34977187300b33e638c4dbf to your computer and use it in GitHub Desktop.
csv_a_lot_fields_read.py
import io
import csv
data = []
for l in range(10):
fields = []
for f in range(1000000):
fields.append('"field{}"'.format(f))
fields = ",".join(fields)
data.append(fields)
data = "\n".join(data) + "\n"
buff = io.StringIO(data)
reader = csv.reader(buff)
for row in reader:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment