csvpp

csvpp Mercurial Source Tree


Root/csvtest.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import csv
 
ifile = open("sampledata.csv")
reader = csv.DictReader(ifile)
 
rownum = 0
header = []
 
for r in reader:
    print r
#for row in reader:
#   if rownum == 0:
#       header = row
#   else:
#       colnum = 0
#       for col in row:
#           print "%s => %s" % (header[colnum], col)
#           colnum += 1
#
#   print "\n"
#   rownum += 1
 
ifile.close()
Source at commit 6bb7abecbe5c created 11 years 4 months ago.
By Nathan Adams, Fixing variable

Archive Download this file

Branches

Tags

Page rendered in 2.01887s using 11 queries.