Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-30 Thread gwenn
Hello, I've tested the improved ".import" command and it seems that there is a bug with empty not-quoted field: $ cat empty.csv A|B | $ ./a.out SQLite version 3.8.0 2013-06-28 23:55:45 sqlite> .import empty.csv test empty.csv:2: expected 2 columns but found 1 - filling the rest with NULL sqlite>

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
27, 2013 4:01 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import command handles quotation incorrectly > > > -Original Message- > > From: sqlite-users-boun...@sqlite.org > > [mailto:sqlite-users-boun...@sqlite.org] On Behalf &

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf > Of Richard Hipp > Sent: Thursday, June 27, 2013 9:16 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import comm

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf > Of Richard Hipp > Sent: Thursday, June 27, 2013 9:16 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import comm

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Richard Hipp
On Thu, Jun 27, 2013 at 8:58 AM, Richard Hipp wrote: > > What if, instead of a new command, we simply extend the ".import" command > so that if the first character of the filename is "|" it interprets the > filename as a pipe instead of a file. The ".output" command works that

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf > Of Richard Hipp > Sent: Thursday, June 27, 2013 8:30 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import comm

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Richard Hipp
On Thu, Jun 27, 2013 at 9:23 AM, Konrad Hambrick wrote: > How do I learb more about the Contributor License Agreement ? > > I don't see it on the WebSite ... > Background information: http://www.sqlite.org/copyright.html CLA: http://www.sqlite.org/copyright-release.pdf --

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf > Of Richard Hipp > Sent: Thursday, June 27, 2013 7:59 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import comm

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Richard Hipp
On Thu, Jun 27, 2013 at 8:53 AM, Konrad Hambrick wrote: > > Hmmm ... I don't believe my patch file went thru ... > > Is there an acceptable method to include text files ? > We cannot accept your patch anyhow, unless you have a Contributor License Agreement on file. To do

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
Hmmm ... I don't believe my patch file went thru ... Is there an acceptable method to include text files ? Thanks. -- kjh ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-27 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] > On Behalf Of RSmith > Sent: Wednesday, June 26, 2013 10:21 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] sqlite3: .import comm

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Hick Gunter
i 2013 14:48 An: General Discussion of SQLite Database Betreff: Re: [sqlite] sqlite3: .import command handles quotation incorrectly Expanding on what Jay replied to: > Hi, > > well we could discuss endlessly, what well formed CSV files are. Not really, the rules are pretty set in

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Richard Hipp
On Wed, Jun 26, 2013 at 6:23 PM, RSmith wrote: > I have done ludicrous amounts of testing and evaluating imports for and > from CSVs > I made a go at improving the CSV importer for the upcoming SQLite 3.8.0 release. Please see the latest trunk check-in. Your expert

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread RSmith
On 6/26/2013 11:21 AM, RSmith wrote: I meant if a real csv interpreter conforming to RFC4180 were to read the garbage I posted, it would come up with the result specified. How do you know what a standard-conforming interpreter would do when presented with input that's invalid under that

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Reinhard Nißl
Hi, my below answer was wrong -- my approach produces a different output. Am 26.06.2013 15:12, schrieb Nißl Reinhard: Your sample [123, 9" Nail, ", Caliper, "set, up 5"", hold", 8 ] gives currently the following column values (I used > and < to indicate the string bounderies, so that any

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Igor Tandetnik
On 6/26/2013 11:21 AM, RSmith wrote: I meant if a real csv interpreter conforming to RFC4180 were to read the garbage I posted, it would come up with the result specified. How do you know what a standard-conforming interpreter would do when presented with input that's invalid under that

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Jay A. Kreibich
On Wed, Jun 26, 2013 at 10:53:38AM -0700, Roger Binns scratched on the wall: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 26/06/13 05:07, Jay A. Kreibich wrote: > > A year or so ago there was some effort to write a plug-in that would > > use the standard Python CSV module (at least,

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread RSmith
On 2013/06/26 15:21, Igor Tandetnik wrote: For instance, what is the resulting fields from this CSV: [123, 9" Nail, ", Caliper, "set, up 5"", hold", 8 ] In REAL CSV terms that would be:123 | 9 Nail, | Caliper | set, up 5", hold | 8 If by REAL CSV you mean the format specified in

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Nißl Reinhard
no++; if( !inQuote && c==p->separator[0] && strncmp(z,p->separator,nSep)==0 ){ *z = 0; i++; if( imailto:sqlite-users-boun...@sqlite.org] Im Auftrag von RSmith Gesendet: Mittwoch, 26. Juni 2013 14:48 An: General Discussion of SQLi

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Igor Tandetnik
On 6/26/2013 8:48 AM, RSmith wrote: Expanding on what Jay replied to: well we could discuss endlessly, what well formed CSV files are. Not really, the rules are pretty set in stone, it isn't open to interpretation. For instance, what is the resulting fields from this CSV: [123, 9" Nail, ",

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread RSmith
Expanding on what Jay replied to: Hi, well we could discuss endlessly, what well formed CSV files are. Not really, the rules are pretty set in stone, it isn't open to interpretation. Given that we cannot fix the generation of the CSV file, why not making the importer a little bit smarter?

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Niall O'Reilly
On 26 Jun 2013, at 13:07, Jay A. Kreibich wrote: > We've been through this before a > half-dozen times. Everyone seems convinced it would be really easy > and really simple to make just one small change so that the importer > works with their version CSV. Not everyone; I may be in a

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Jay A. Kreibich
On Wed, Jun 26, 2013 at 12:35:55PM +0200, Nißl Reinhard scratched on the wall: > well we could discuss endlessly, what well formed CSV files are. > Given that we cannot fix the generation of the CSV file, why not > making the importer a little bit smarter? The standard answer to this is, "Go

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-26 Thread Nißl Reinhard
e Nachricht- Von: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] Im Auftrag von Petite Abeille Gesendet: Dienstag, 25. Juni 2013 19:27 An: General Discussion of SQLite Database Betreff: Re: [sqlite] sqlite3: .import command handles quotation incorrectly On Jun 25, 201

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-25 Thread Petite Abeille
On Jun 25, 2013, at 11:19 AM, Nißl Reinhard wrote: > because it stays in quotation mode until it finds a further ", which is > incorrect. Quotation mode may only get activated when " appears at the > beginning of a column value. Meh… check the recent "escape quote for

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-25 Thread RSmith
Correction - Official CSV fields may not start with specifically CR/LF before quotes as it is the official record delimeter for CSV, but it may well contain them within quotes in a single field. Thanks. On 2013/06/25 12:21, RSmith wrote: ...//it may also start with any whitespace characters

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-25 Thread RSmith
Hi Reinhard - studying this CSV formatting (and file-formatting in general) is somewhat of a hobby of mine and have solved many issues around it, so I can tell you that your request is a border case and found nowhere else in CSV realms. I think that whatever system is making the files you are

[sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-25 Thread Nißl Reinhard
Hi, for example, it cannot import the column value 19" rack because it stays in quotation mode until it finds a further ", which is incorrect. Quotation mode may only get activated when " appears at the beginning of a column value. Once the line has been broken into column

[sqlite] sqlite3 .import command

2005-01-19 Thread stoertebecker
In Sqlite3 the .import command replaces the old COPY. When I try to use it to import a .csv file into a table t1 in database test.db I always get the error message Error: no such table : t1; Probably I've got something wrong with the syntax of the .import command: I used >sqlite3 test.db