CSV as data source, bugs?

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
poorboywilly
Posts: 2
Joined: Tue Jan 01, 2008 12:04 am

CSV as data source, bugs?

Post by poorboywilly »

OK, I'm trying to create a database that gets its data from a CSV file. I created a database in OOo Base that uses the directory the file is located in and *.csv files as the tables. So now I can see the .csv file as a 'Table' in my database. Good. However, upon examining this table, it is seriously broken.

I selected "Edit/Database/Properties..." from the menu and then navigated to the "Additional Settings" tab of the dialog that was presented to me in order to change the database settings in hopes of getting a more correct database. When I attempt to change the "Field separator" to a comma, it seems to actually take the change to heart when I look at the actual table, but when I open up the "Database Properties" dialog again, it has changed the "Field separator" back to a semicolon. No big deal, I changed the field delimiters in my CSV to semicolons, and then leave the "Field separator" as a semicolon.

However, there is still another problem. The records that have an embedded newline are not parsed correctly into the table, even though the fields all have double quotes around them. Experimenting with different "Text separator" settings (and thus different quote characters in the CSV) in the "Database Properties" dialog does not help this.

This is all very curious to me, especially since the importation of CSV data with OOo Calc is so smooth (and handles the embedded newlines just fine). Does anyone have any ideas here?

thanks,
--Jason
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA

Re: CSV as data source, bugs?

Post by DrewJensen »

When you say that the fields with embedded NL are handled improperly do you mean that the data is truncated or that the NL is not displayed properly.

Because - by default the grid controls do not wrap text and NLs are simply ignored - you need to explicitly select a column and set the display properties to get the wrapped text - just a thought?
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
poorboywilly
Posts: 2
Joined: Tue Jan 01, 2008 12:04 am

Re: CSV as data source, bugs?

Post by poorboywilly »

Hm, I can't seem to find what you mean about setting the display properties, but regardless, I don't think that's it, since all the fields in the same record and then all the records after a newline a filled with the wrong data.
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA

Re: CSV as data source, bugs?

Post by DrewJensen »

No that sounds like a bug..

Since it sounds as if you have control over the layout of the file have you looked at using a linked TEXT table to a standard Base database, versus the TEXT data source.

You can see what I mean by that in this post
http://user.services.openoffice.org/en/ ... 4245#p4245
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
Post Reply