Re: [sqlite] CSV import deletes trailing zeroes on text fields

2018-07-13 Thread David Raymond
Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Robert Weiss Sent: Thursday, July 12, 2018 6:01 PM To: SQLite mailing list Subject: Re: [sqlite] CSV import deletes trailing zeroes on text fields 1. Rename .csv to .txt2. Excel will now ask f

Re: [sqlite] CSV import deletes trailing zeroes on text fields

2018-07-12 Thread Robert Weiss
1. Rename .csv to .txt2. Excel will now ask for column treatment on import3. Specify the problem column(s) as "text" not "general" There are other problems with csv recognizing text as numbers. I had a column with content, say 123D4. Excel recognized the old FORTRAN double precision format and

Re: [sqlite] CSV import deletes trailing zeroes on text fields

2018-07-12 Thread David Burgess
"CSV import deletes /leading/ zeroes on text fields" excel does this. Quite difficult to stop it from doing so. On Fri, Jul 13, 2018 at 6:52 AM, R Smith wrote: > I believe your subject should read: "CSV import deletes /leading/ zeroes on > text fields" - Your trailing Zero is in tact. > > And

Re: [sqlite] CSV import deletes trailing zeroes on text fields

2018-07-12 Thread R Smith
I believe your subject should read: "CSV import deletes /leading/ zeroes on text fields" - Your trailing Zero is in tact. And your declaration is wrong - in SQL the column name is first, then the Type, so it must be: CREATE TABLE foo(bar TEXT NOT NULL); Opening the csv file in Excel or CALC

Re: [sqlite] CSV import deletes trailing zeroes on text fields

2018-07-12 Thread Simon Slavin
On 12 Jul 2018, at 9:47am, Simon Leo Hafner wrote: > create table foo ( > text bar not null > ); Should be bar TEXT NOT NULL I'm not sure how your line is being parsed, but I can understand it thinking you have not set a column type. Simon.

[sqlite] CSV import deletes trailing zeroes on text fields

2018-07-12 Thread Simon Leo Hafner
To reproduce: create table foo ( text bar not null ); .import test.csv foo select * from foo; With test.csv: test 01230 Expected result: test 01230 Actual result: test 1230 ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org