Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-15 Thread dan
Thanks Hick, I've actually never hear of Virtual Tables so I'll take a look at play around with this. Thanks, Dan On 2017-06-14 18:44, Hick Gunter wrote: I have found it much simpler and more robust to write a CSV virtual table to handle the formatting. e.g. CREATE VIRTUAL TABLE csv_input

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-15 Thread dan
Thanks Ketil I'll definitely take a look! FYI my script is available here: https://github.com/64b2b6d12b/spotkey Thanks, Dan On 2017-06-14 18:02, Ketil Froyn wrote: Dan, I'd recommend using a tool that actually understands CSV, and make it parse the input and create new quoted output. I

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-14 Thread Hick Gunter
I have found it much simpler and more robust to write a CSV virtual table to handle the formatting. e.g. CREATE VIRTUAL TABLE csv_input USING csv ( ); Opens the named file, reads the first line and interprets the contents as a list of field names. You can then INSERT INTO SELECT FROM

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-14 Thread Ketil Froyn
Dan, I'd recommend using a tool that actually understands CSV, and make it parse the input and create new quoted output. I haven't seen your sed and awk, but I'm pretty sure it's easy to find some special cases where the text includes comma, quotes or even newlines that will break your output. A

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-13 Thread dan
Thanks Richard, in the end I added the quotes using some SED and AWK as I'm using SQLite as part of a BASH script. Thanks On 2017-06-13 14:36, Richard Hipp wrote: SQLite does not provide that capability, that I recall. But surely it would not be too difficult for you to do your own custom

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-12 Thread Richard Hipp
SQLite does not provide that capability, that I recall. But surely it would not be too difficult for you to do your own custom patch, or even to write a short program to output the data in the precise format you desire? On 6/12/17, d...@dan.bz wrote: > Hi, > > When outputting to

[sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-12 Thread dan
Hi, When outputting to CSV with '.mode csv' is there a way that all rows can be quoted even if there are no spaces? For example, here is a 1 line from the output: spotify:track:5vlDIGBTQmlyfERBnJOnbJ,Kiso,Circles,100.019 I would like it to output: