title: SQLite .output stdout
body: <p>I'm trying to export a csv file to a fixed length file.
  I'm using SQLite because I have to process the file.</p>
  
  <p>The problem I'm having is with the output.</p>
  
  <p>Here is the code I am running from a sql file:</p>
  
  <pre><code>.output stdout          --send output to screen
  .echo off
  .headers off 
  .separator ','
  .mode column
  
  .open tmp.db
  DROP TABLE IF EXISTS myData;
  
  .import 'C:\2015.csv' myData
  .width 4 4 1 6 16 2 6 
  
  .output myData.txt      --send output to file
  select * from myData;
  
  .output stdout          --send output back to screen
  .print "File was created."
  
  DROP TABLE IF EXISTS myData;
  vacuum;
  .print "tmp.db vacuum complete"
  .print "Type '.exit' or '.quit' to exit SQLite"
  
  .exit
  </code></pre>
  
  <p>The problem is that in the first line, where I send the output to the screen, I get an error:</p>
  
  <blockquote>
    <p>Error: unknown command or invalid arguments: "output". Enter ".help"
    for help</p>
  </blockquote>
  
  <p>The script executes, but it actually displays the results of the sql (and it also writes them to the file).</p>
  
  <p>However, if I run every single command from the sqlite console, everything works fine.  I only get the error when I run it from the SQLite console using .read</p>
  
  <p>Any suggestions?  What am I missing?  I checked the docs in the SQLite website, and in the example presented they switch the output from console to file and back in the same manner.</p>
  
  <p>Thank you.</p>