user1876508 user1876508 - 2 years ago 97
Python Question

Access individual cells in csv file with python

How can I access individual cells in a csv document to parse and edit them? Also is there a way I can convert the csv document into a two-dimensional array?

Answer Source

You are going to want to use the csv package that is made for python. You may want to try something like this (assuming your file is regularly structured and has no headers):

data = []
for row in csv.reader(open('you_file.csv', 'rb'), delimiter=',')

Give that a try and look through the csv package docs to learn more.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download