title: How to use csv.Sniffer for 2 different CSV-types?
body: <p>I want to read 2 different types of CSV-files:</p>
  
  <ul>
  <li>one with a <code>','</code> as delimiter   </li>
  <li>one with a <code>';'</code> as delimiter</li>
  </ul>
  
  <p>I tried to check which delimiter I'm using by doing:   </p>
  
  <pre><code>dialect = csv.Sniffer().sniff(csvfile, [',', ';'])  
  data = csv.reader(csvfile, dialect)
  </code></pre>
  
  <p>but then I get the <code>TypeError : expected string or buffer</code>.</p>
  
  <p>If I do this, it works, but then I don't know when to use what delimiter.</p>
  
  <pre><code>data = csv.reader(csvfile, delimiter = ",")  
  data = csv.reader(csvfile, delimiter = ";")
  </code></pre>
  
  <p>Can someone help me please? </p>