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 called it 1230000.

    On Thursday, July 12, 2018, 2:39:09 PM PDT, David Burgess 
<dburges...@gmail.com> wrote:  
 
 "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 <ryansmit...@gmail.com> wrote:
> 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 will probably do the exact same thing
> - but SQLite should be better than that.
>
>
>
> On 2018/07/12 10:47 AM, Simon Leo Hafner wrote:
>>
>> 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
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
  
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to