Question: I have an Excel table saved as a CSV that looks something like (when it's in Excel) this just longer:

```
    Monday  Tuesday     Wednesday   Thursday    Friday
marsbar 9   8   0   6   5
reeses  0   0   0   9   0
twix    2   3   0   5   6
snickers    9   8   0   6   5

```

(The format isnt perfect, but you get the gist--candy bars/day). I want to write a program for python in which I could input a list of candy bar names in the program

```
>>> ['twix', 'reeses']

```

and it would give me the days of the week on which those candy bars were eaten and how many candy bars in the list were eaten on that day. The result would look something like this:

```
Monday 2
Tuesday 3
Wednesday 0
Thursday 14
Friday 6

```

could someone help me write such a program?

Answer: 
Maybe with the [csv module](http://docs.python.org/library/csv.html)

I suppose the delimiter is the tab character (`\t`)

```
import csv
reader = csv.reader(open('csv_file.csv', 'rb'), delimiter='\t')
for row in reader:
    print row

>>>['Monday','Tuesday', 'Wednesday', 'Thursday', 'Friday']
['marsbar', '9', '8','0', '6', '5']
['reeses', '0', '0', '0', '9', '0']
['twix', '2', '3', '0', '5', '6']
['snickers', '9', '8', '0',  '6',  '5']

```
In addition to the other answers, you may also want to take a look at the xlrd module, as it can deal with the excel spreadsheets directly if you'd rather not deal with CSV business. The module allows you to read entire (or ranges) of rows/columns at a time as well as grabbing individual cells and you can iterate through everything to search for what you want and then return whatever related 'values' you want in the same row/column from where you found your search criteria.