Im pretty new to Python, so i apologise in advance.
My main goal is to parse a csv file (as per below) and to create a list named based on column 5 which includes values from column 7 as the elements.
01/11/2010,DEB,12345,12345,CREDIT CARD,,44
01/11/2010,DEB,12345,12345,TAKE AWAY,,20
01/11/2010,DEB,12345,12345,TAKE AWAY,,22
01/11/2010,DEB,12345,12345,TAKE AWAY,,24
The code I have so far is :
#!/usr/bin/python
import csv
import string
itemlist = []
reader = csv.reader(open("statement.csv", "rb"))
for row in reader:
itemlist.append(row[4])
itemlist = list(set(itemlist))
for x in itemlist[:]:
item = x
item = []
The bit im getting a bit lost on is how to create a list from each element of my itemlist list.
Thanks in advance...