Page 1 of 1

[Solved] Database linked csv, problem with field types

PostPosted: Mon May 30, 2016 7:06 am
by blah_blah_blah
Hi there.

I have a base file linked to a directory of csv files.

My problem is, I can't seem to change how the fields are read in the database.

I've read somewhere that they are decided on by reading the second line of the csv (after the headers) and then whatever datatype is present in the column will decide the field type for the whole column.

I've done some testing with this and it looks like I'm getting random results with how the data is read. I want the data as a number type so I can make a SUM with the column when imported to calc. however quite often the data is read as a TEXT field and causes problems.

the csv file is updated daily from the internet hence the csv directory structure.

Any help would be appreciated.

Re: database linked csv, problem with field types

PostPosted: Mon May 30, 2016 9:35 am
by RoryOF
A small sample file would help.

Re: database linked csv, problem with field types

PostPosted: Mon May 30, 2016 4:01 pm
by Villeroy
The text driver for Base has not enough import options to meet common requirements. It works fine with unquoted numbers and all numerals according to the global setting. You can set the decimal separator independently from any locale but "special numbers" (mostly dates, times, booleans)" are interpreted in the global locale context.

Re: database linked csv, problem with field types

PostPosted: Wed Jun 01, 2016 3:56 am
by blah_blah_blah
Thanks for the help,

I ended up going with what is explained in
https://forum.openoffice.org/en/forum/v ... 83&t=23260