how to get data from csv file in python
Question: I am using csv.reader to read file but it giving me whole file.

    
    
    file_data = self.request.get('file_in');
    file_Reader = csv.reader( file_data );
    for fields in file_Reader:
    

I want one line at a time and separate data from that line.

    
    
    ex: filedata = name,sal,dept
                   x,12000,it
    o\p=
    name
    sal
    dept
    .
    .
    .
    


Answer: This

    
    
    >>> import csv
    >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|')
    >>> for row in spamReader:
    ...     print ', '.join(row)
    Spam, Spam, Spam, Spam, Spam, Baked Beans
    Spam, Lovely Spam, Wonderful Spam
    

Was taken from [the manual](http://docs.python.org/library/csv.html)

Hope that helps...

