hello,
I have a csv file that has 13 columns. Some columns are filled, some are blank. What I need to do is pull up the csv file, read the columns into a list or array and then put each column into its own variable that can be referenced in an email script that I've already written.
Here is my code so far where my output is all of my columns but I'm stuck after this. Any help would be greatly appreciated!
I have a csv file that has 13 columns. Some columns are filled, some are blank. What I need to do is pull up the csv file, read the columns into a list or array and then put each column into its own variable that can be referenced in an email script that I've already written.
Here is my code so far where my output is all of my columns but I'm stuck after this. Any help would be greatly appreciated!
Code:
#!/usr/bin/python
import csv
a = [];
i=0;
b='';
csvReader = csv.reader(open('sample.csv', 'rb'), delimiter='|');
for row in csvReader:
a.append(row);
for i in range(0, len(a)):
print a[i];
Comment