CSV Example 3(find the particular salaries)


salaries.csv
===========

['deepak', 'hyderabad', '2000']
['santosh', 'guntur', '3000']
['sachin', 'hyderabad', '2000']


csvtest.py
========

import csv
import collections
with open('salaries.csv','rb') as f:
    reader=csv.reader(f)
   
   
  
    for row in reader:
        #print row[0]
        if row[0]=='deepak':
           print row


o/p
===
>>import csvtest
['deepak', 'hyderabad', '2000']
>>>




No comments:

Post a Comment