title: File splitting using python
body: <pre><code>import csv
  import os
  mycsv =csv.reader(open("IF_1027_SampleFile.csv","r"))
  mycsv1 =csv.reader(open("Output","a"))
  search_query ='Record Detail'
  line =mycsv.readline()
  if line==Searchquery:
      mycsv1.write(line)
      line =mycsv.readline()
  else
      infile.close()
      outfile.close()
  </code></pre>
  
  <p>Now I am getting the following error:</p>
  
  <pre><code>SyntaxError: ("mismatched input 'mycsv1' expecting INDENT", ('&lt;string&gt;', 9, 0, 'mycsv1.write(line)\n'))
  </code></pre>
  
  <p>Can you help me on this. Where am I doing wrong?</p>