Aaron Peterson wrote: > > On 12/7/05, Teg <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > Wouldn't it make sense to write a program that reads it in, one line > > at a time, splits and inserts the data into the proper tables? Even > > creating the table on the fly? That's what I'd do, a little command > > line utility. > > One could probably look at the mysqlimport source code for > inspiration. It would be nice to have a little command line utility > for this as part of the main sqlite package... This *can* be done > with a sed or perl script, but it becomes increasingly difficult when > the values also include commas, in which case programs often > additionally enclose the values in quotes, etc. mysqlimport has nice > switches (--optionally-enclosed-by) to take care of cases like these > so that everyone doesn't have to be a perl or sed genius to import > some text file data into a table. >
Hm, there is a CSV reading module in Tcllib, so one could contemplate using Tcl instead of Perl for this. That ought to take care of the quotes and other nastiness... Regards, Arjen