title: Reading CSV file from stdin in Python and modifying it
body: <p>I need to read csv file from stdin and output the rows only the rows which values are equal to those specified in the columns. My input is like this:</p>
  
  <pre><code> 2
   Kashiwa
   Name,Campus,LabName
   Shinichi MORISHITA,Kashiwa,Laboratory of Omics
   Kenta Naai,Shirogane,Laboratory of Functional Analysis in Silico
   Kiyoshi ASAI,Kashiwa,Laboratory of Genome Informatics
   Yukihide Tomari,Yayoi,Laboratory of RNA Function
  </code></pre>
  
  <p>My output should be like this:</p>
  
  <pre><code> Name,Campus,LabName
   Shinichi MORISHITA,Kashiwa,Laboratory of Omics
   Kiyoshi ASAI,Kashiwa,Laboratory of Genome Informatics
  </code></pre>
  
  <p>I need to sort out the people whose values in column#2 == Kashiwa and not output first 2 lines of stdin in stdout. </p>
  
  <p>So far I just tried to read from stdin into csv but I am getting each row as a list of strings (as expected from csv documentation). Can I change this?</p>
  
  <pre><code> #!usr/bin/env python3
  
   import sys
   import csv
  
   data = sys.stdin.readlines()
  
   for line in csv.reader(data):
  
        print(line)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> ['2']
   ['Kashiwa']
   ['Name', 'Campus', 'LabName']
   ['Shinichi MORISHITA', 'Kashiwa', 'Laboratory of Omics']
   ['Kenta Naai', 'Shirogane', 'Laboratory of Functional Analysis in 
   Silico']
   ['Kiyoshi ASAI', 'Kashiwa', 'Laboratory of Genome Informatics']
   ['Yukihide Tomari', 'Yayoi', 'Laboratory of RNA Function']
  </code></pre>
  
  <p>Can someone give me some advice on reading stdin into CSV and manipulating the data later (outputting only needed values of columns, swapping the columns, etc.,)?</p>