Reading a CSV file
Fábio Santos
fabiosantosart at gmail.com
Tue Apr 23 19:30:12 EDT 2013
The enumerate function should allow you to check whether you are in the
first iteration.
Like so:
for row_number, row in enumerate(csv.reader(<...>)):
if enumerate == 0:
if <your check...>:
break
...
Enumerate allows you to know how far into the iteration you are.
You could use the iterator's next() method too.
On 23 Apr 2013 23:53, "Ana Dionísio" <anadionisio257 at gmail.com> wrote:
>
> The condition I want to meet is in the first column, so is there a way to
read only the first column and if the condition is true, print the rest?
> --
> http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130424/928b2b7b/attachment.html>
More information about the Python-list
mailing list