title: core data with pre populated sqlite from csv!
body: <p>Ive been struggling with this for a couple of days now and after scouring the internet I still havent got it working. I have a csv file, from which I need to populate an sqlite db to use with core data.</p>
  
  <p>I thought I had found a solution here <a href="http://ablogontech.wordpress.com/2009/07/13/using-a-pre-populated-sqlite-database-with-core-data-on-iphone-os-3-0/" rel="nofollow noreferrer">http://ablogontech.wordpress.com/2009/07/13/using-a-pre-populated-sqlite-database-with-core-data-on-iphone-os-3-0/</a> but I cannot for the life of me get it to work. Here are the steps I have taken.</p>
  
  <ol>
  <li>Created a new Core Data project and generated the model and Managed Object classes;</li>
  <li>Performed a fetch request in vdl of rootViewController (Im not sure why this is neccessary but apparantly it is?)</li>
  <li>Copied the xxx.sqlite from the documents directory of my app into another directory.</li>
  <li>Executed the following sqlite commands from the terminal:</li>
  </ol>
  
  <p>sqlite3 xxx 
  sqlite> .mode csv yyy 
  sqlite> .import yyy.csv yyy</p>
  
  <p>Now when it comes to importing the csv data into my table I get a no such table error! Also when i execute a .tables command I get Z before my table name?
  I have imported data from a csv into a table this way before but not using a core data generated db and I think this is where the problem lies. Does anyone know where Im going wrong or of a better solution to my problem. Please let me know as Im going crazy with this..</p>
  
  <p>Many thanks</p>
  
  <p>Jules</p>