OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

CSV questions

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
colette
Newbie
Newbie


Joined: 25 Mar 2010
Posts: 2

PostPosted: Thu Mar 25, 2010 6:01 am    Post subject: CSV questions Reply with quote

I have a CSV file I want to import into Base.

When ever I try to import the data the I cannot amend or add data, it is read only.

I know that you can copy and paste quite simply from calc but we want to import and export directly from the CSV file

Is this possible?

Thanks

Colette
Back to top
View user's profile Send private message
ftack
Moderator
Moderator


Joined: 27 Jan 2003
Posts: 3102
Location: Belgium

PostPosted: Thu Mar 25, 2010 6:11 am    Post subject: Reply with quote

csv is not designed for that purpose: it is a plain text format. It is merely a format to help transferring data from one database application to another.

Import and export to a native database using Base (mysql, sqlite, ...) then export from that database to a csv when the need arises.
_________________
--
GNU/Linux (Ubuntu)
Back to top
View user's profile Send private message
colette
Newbie
Newbie


Joined: 25 Mar 2010
Posts: 2

PostPosted: Thu Mar 25, 2010 8:35 am    Post subject: Reply with quote

Thanks for your help

we have some software that can only read csv files.
But we would like to creaste a database and everytime we change it's contents we would like the csv file to update as well so the other software can read it.

If this something we can do ?
Back to top
View user's profile Send private message
ftack
Moderator
Moderator


Joined: 27 Jan 2003
Posts: 3102
Location: Belgium

PostPosted: Thu Mar 25, 2010 9:04 am    Post subject: Reply with quote

It seems your software is the problem. This could be done but will require a minimum of programming. Appropriate macros in a form could already do the job (e.g. "Enter" button automatically writes out the csv file).

Depending on your needs, a spreadsheet that saves to csv could be enough. For large needs (i.e. substantial databases) a csv approach will be inefficient anyway.
_________________
--
GNU/Linux (Ubuntu)
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 25, 2010 11:14 am    Post subject: Reply with quote

[Tutorial] Using csv/text files as editable data source.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Thu Mar 25, 2010 1:49 pm    Post subject: Reply with quote

ftack wrote:
csv is not designed for that purpose: it is a plain text format. It is merely a format to help transferring data from one database application to another.

Import and export to a native database using Base (mysql, sqlite, ...) then export from that database to a csv when the need arises.


Hi ftack,
I seem to be missing something here. Colette says, "I have a CSV file I want to import into Base.". If csv is designed for this is there a problem with importing the file to the Base database engine? Otherwise I cannot see why one cannot use a CSV file ( intended for data transfer between data bases) to load into Base. What am I missing?
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 25, 2010 3:14 pm    Post subject: Reply with quote

The only problem is that Base is not a database. It can not open any file type other than its own configuration files, the so called "database documents".
The HSQLDB engine shipped with OOo is a database program. It runs in the background and does the actual work when you create a brand new database in Base.
That software is able to fill a prepared table with the contents of a text file so an assumed user may not even notice that he is editing a text file.
[Example] Loading CSV into preformatted spreadsheets (file #1 and #2 demonstrate this technique)
You can talk to that software through the Base "command line" menu:Tools>SQL...
Other database engines can do the same trick.
When your Base file is connected to a MySQL database you can make that database server use text files: http://dev.mysql.com/doc/refman/5.1/en/csv-storage-engine.html

Base can use a whole directory of similarly structured csv as a pseudo database providing read-only access. You connect a Base file to the directory, specify the delimters and encoding and then you have read access to the csv tables from any OOo document.
[Example] Loading CSV into preformatted spreadsheets (files 1, 3. 4 and 5)

You can copy database row sets into documents and to other databases with write access so your read-only csv-connection can be used as import facility for other databases.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Sat Mar 27, 2010 6:17 am    Post subject: Reply with quote

Villeroy wrote:
The only problem is that Base is not a database. It can not open any file type other than its own configuration files, the so called "database documents".
The HSQLDB engine shipped with OOo is a database program. It runs in the background and does the actual work when you create a brand new database in Base.
That software is able to fill a prepared table with the contents of a text file so an assumed user may not even notice that he is editing a text file.
[Example] Loading CSV into preformatted spreadsheets (file #1 and #2 demonstrate this technique)
You can talk to that software through the Base "command line" menu:Tools>SQL...
Other database engines can do the same trick.
When your Base file is connected to a MySQL database you can make that database server use text files: http://dev.mysql.com/doc/refman/5.1/en/csv-storage-engine.html

Base can use a whole directory of similarly structured csv as a pseudo database providing read-only access. You connect a Base file to the directory, specify the delimters and encoding and then you have read access to the csv tables from any OOo document.
[Example] Loading CSV into preformatted spreadsheets (files 1, 3. 4 and 5)

You can copy database row sets into documents and to other databases with write access so your read-only csv-connection can be used as import facility for other databases.

Oh I see. Thanks.
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group