Created
October 18, 2011 20:40
-
-
Save beauvais/1296653 to your computer and use it in GitHub Desktop.
print row range
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
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