[Solved] Database linked csv, problem with field types

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER

[Solved] Database linked csv, problem with field types

Postby blah_blah_blah » Mon May 30, 2016 7:06 am

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.
Last edited by Hagar Delest on Wed Jun 01, 2016 10:37 pm, edited 1 time in total.
Reason: tagged [Solved].
Llibreoffice 4.3 on Debian Linux
blah_blah_blah
 
Posts: 8
Joined: Mon Feb 22, 2016 1:21 am

Re: database linked csv, problem with field types

Postby RoryOF » Mon May 30, 2016 9:35 am

A small sample file would help.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28546
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: database linked csv, problem with field types

Postby Villeroy » Mon May 30, 2016 4:01 pm

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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26541
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: database linked csv, problem with field types

Postby blah_blah_blah » Wed Jun 01, 2016 3:56 am

Thanks for the help,

I ended up going with what is explained in
https://forum.openoffice.org/en/forum/v ... 83&t=23260
Llibreoffice 4.3 on Debian Linux
blah_blah_blah
 
Posts: 8
Joined: Mon Feb 22, 2016 1:21 am


Return to External Data Sources

Who is online

Users browsing this forum: No registered users and 1 guest