title: Sqlite3 import csv not working
body: <p>I followed instructions on this page <a href="https://www.sqlite.org/cli.html#section_8" rel="nofollow">https://www.sqlite.org/cli.html#section_8</a> to import a csv file (on Linux) but failed: </p>
  
  <pre><code>$ sqlite3 testdb
  -- Loading resources from /home/abcd/.sqliterc
  
  SQLite version 3.7.17 2013-05-20 00:56:22
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite&gt; .mode csv
  sqlite&gt; .import sample_data.csv maintable
  Error: no such table: maintable
  sqlite&gt; 
  </code></pre>
  
  <p>It is a simple csv file: </p>
  
  <pre><code>$ cat sample_data.csv
  roll_no,candidate_name,subject,marks,grade
  1234567,ABCD EFGH,301,38,A2
  7654321,XYZ ABC,301,64,B1
  9876564,ABCD FGLG,301,50,A1
  ...
  </code></pre>
  
  <p>testdb does not exist to begin with and should be a new database to be created. However, only a 0 byte database is created and the csv file is not imported (see error above). </p>
  
  <p>It does work if I manually create a table with all fields. Why are the fields not being created automatically as mentioned on the official page of <a href="https://www.sqlite.org/cli.html#section_8" rel="nofollow">https://www.sqlite.org/cli.html#section_8</a> . Is it a version problem?</p>
  
  <p>Thanks for your help.</p>