[sqlite] PATCH: [sqlite] sqlite output request: .mode csv

2004-09-13 Thread Ron Aaron

On Mon, September 13, 2004 12:14, Ron Aaron said:

Responding to my own complaint: here is a patch against current CVS version,
fixing the typo in the '-help' and implementing ".mode cvs" properly (at
least, in my opinion)


-- 
My GPG public key is at http://ronware.org/
fingerprint: 8130 734C 69A3 6542 0853  CB42 3ECF 9259 AD29 415D



shell.c.diff.gz
Description: GNU Zip compressed data


Re: [sqlite] sqlite output request: .mode csv

2004-09-13 Thread Ron Aaron

On Mon, September 13, 2004 8:28, Ron Aaron said:
> I have been asked to output an 'Excel'-friendly report for someone, which
> means dumping a "CSV" (Comma Separated Values) file.
>
> Setting ".separator ',' " gets me part of the way.  Unfortunately, I need to
> manually quote strings using something like this:
>

Oh!  I just saw that sqlite3 has a ".mode cvs".

Two comments:

1) the help says 'csv' instead of 'cvs'.
2) the mode is exactly the same as 'list'.  It should double-quote output
strings.

-- 
My GPG public key is at http://ronware.org/
fingerprint: 8130 734C 69A3 6542 0853  CB42 3ECF 9259 AD29 415D





[sqlite] sqlite output request: .mode csv

2004-09-13 Thread Ron Aaron
I have been asked to output an 'Excel'-friendly report for someone, which
means dumping a "CSV" (Comma Separated Values) file.

Setting ".separator ',' " gets me part of the way.  Unfortunately, I need to
manually quote strings using something like this:

SELECT '"' || name || '"', '"' || address || '"', zipcode
FROM clients;

It would be mighty handy if sqlite had a '.mode csv' option which would
auto-quote strings and not quote numbers, and put commas between them.  This
is an extremely common format...

Perhaps ".mode" is not the correct place to do this, but something similar
would be great.

Thanks!


-- 
My GPG public key is at http://ronware.org/
fingerprint: 8130 734C 69A3 6542 0853  CB42 3ECF 9259 AD29 415D