On Fri, 2005-09-23 at 13:00 -0400, Richard Nagle wrote:
> is there a easier way of typing in data to Sqlite.
> 
> sqlite> insert into car (md_num, md_name, style, year)
>     ...> values (1, 'Honda', 'Coupe', 1983)
>     ...> ;
> 
> Man, just 806 more listing....
> just looking for some short cuts, or helper apps...etc.
> to cut down some of the typing.
> 

Use a script to read and parse your original data source.
An example (untested) TCL script for pipe-separated data
is shown below.  Similar things are doable in other
scripting languages.

  package require sqlite3
  sqlite3 db new_database.db
  set in [open input_file.txt]
  db transaction {
    while {![eof $in]} {
      set line [split [gets $in] |]
      foreach {md_num md_name style year} $line {
        db eval {INSERT INTO car VALUES($md_num, $md_name,
                      $style, $year)}
      }
    }
  }


Reply via email to