Skip to content

Instantly share code, notes, and snippets.

@beauvais
Created October 18, 2011 20:40
Show Gist options
  • Save beauvais/1296653 to your computer and use it in GitHub Desktop.
Save beauvais/1296653 to your computer and use it in GitHub Desktop.
print row range
csvFile = csv.reader(open('survey.csv', 'rb'), delimiter=',')
header = next(csvFile)
for row in csvFile:
devStatus = row[4]
address = row[14]
commercial = row[12]
# note = row[20]
industry = row[10]
if row[20]:
print row[20]
$ python csvchop.py
string
string
string
string
Traceback (most recent call last):
File "csvchop.py", line 18, in <module>
if row[20]:
IndexError: list index out of range
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment