Reading from CSVs in Python repeatedly?
Posted
by matt
on Stack Overflow
See other posts from Stack Overflow
or by matt
Published on 2010-05-19T18:42:10Z
Indexed on
2010/05/19
19:00 UTC
Read the original article
Hit count: 129
I'm trying to check the value of extracted data against a csv I already have. It will only loop through the rows of the CSV once, I can only check one value of feed.items(). Is there a value I need to reset somewhere? Is there a better/more efficient way to do this? Thanks.
orig = csv.reader(open("googlel.csv", "rb"), delimiter = ';')
goodrows = []
for feed in gotfeeds:
for link,comments in feed.items():
for row in orig:
print link
if link in row[1]:
row.append(comments)
goodrows.append(row)
© Stack Overflow or respective owner