import csv and then be able to add year revenue

Joined
Jul 12, 2010
Messages
2
Reaction score
0
So basically what i want wanting to do is import a csv file and then have the user specify what year they want to add up all the total revenue.


here is what is in my csv file

Code:
2009|1|22|56.23
2009|4|12|86.24
2009|5|20|34.67
2009|6|22|12.67
2009|3|21|795.12
2008|7|4|753.43
2008|8|9|2345.45
2008|9|1|2357.23
2010|5|2|7552.21
2010|3|15|666
2010|4|17|2323.75
2010|5|19|2367.23
2010|6|25|6453
2010|2|6|1267.12

here is what i have so far
Code:
import csv

reader = csv.reader(open("/Users/keith/Desktop/revenue.csv", "rb"))
for row in reader:
    print(row)

so here i am stuck now..i want to take the revenue numbers and add them. i want the user to be able to pick the year though.

thanks
keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top