title: Exporting data from SQLite 3
body: <p>I need a simple way to export data from an SQLite database of multiple tables, then import them into another database.</p>
  
  <p>Here is my scenario.  I have 5 tables: A, B, C, D, E.</p>
  
  <p>Each table has a primary key as the first column called ID.  I want a Unix command that will dump ONLY the data in the row from the primary key in a format that can be imported into another database.  </p>
  
  <p>I know I can do a </p>
  
  <pre><code>sqlite3 db .dump | grep INSERT
  </code></pre>
  
  <p>but that gives me ALL data in the table.  I'm not a database expert, and I'm trying to do this with all unix commands in which I can write a shell script, rather than writing C++ code to do it (because that's what people are telling me that's the easiest way).  I just refuse to write C++ code to accomplish a task that possible can be done in 4-5 statements from the command line.</p>
  
  <p>Any suggestions?</p>