T&B wrote:


1. Is this a known bug in SQLite's csv output? Will it be fixed?
Tom,

Yes this is a know issue. I wouldn't hold my breath waiting for it to be fixed


2. Is there another way to reliably get the contents of a database via the command line? It must handle values containing pipes, quotes, commas, carriage returns etc.


You could try using the line mode output. It puts each field on a line of its own, and separates each record with a completely blank line. A sample is shown below.

   sqlite> select * from t2;
       a = 1
       b = 2

       a = 3
       b = 4

       a = test
       b = |,"

       a = test
       b = one
    two
    three
   sqlite>

It will wrap fields that contain newlines onto multiple lines as shown above. You will have to handle the case of back to back newlines by looking for the " fieldname = " string at the beginning of each record.

In reality though, you should probably look at using the library API functions directly rather than trying to execute SQL using the command line shell program. It is intended primarily as a quick and dirty way to poke around in a database, and as an example of how to use the API functions. You haven't said what language you are programming in. Perhaps you need some help using the C API from your chosen language.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to