Command Line Shell for SQLite (Cont.)

.mode   mode  [ table ]
Set output mode where the mode is one of the following options:

  • csv: Comma-separated values,
  • column: Left-aligned columns,
  • html: HTML <table> code,
  • insert: SQL insert statements for table,
  • line: One value per line,
  • list: Values delimited by .separator string,
  • tabs: Tab-separated values, and
  • tcl: TCL list elements

For example,
  sqlite> select * from comments; 
    36|Hate it
    37|Very nice

  sqlite> .mode line 
  sqlite> select * from comments; 
        _id = 36
    comment = Hate it
        _id = 37
    comment = Very nice

  sqlite> .mode column 
  sqlite> select * from comments; 
    36          Hate it
    37          Very nice
.separator   string
Change separator used by output mode. For example,
  sqlite> .separator ", " 
  sqlite> select * from comments; 
    36, Hate it
    37, Very nice