| View previous topic :: View next topic |
| Author |
Message |
colette Newbie

Joined: 25 Mar 2010 Posts: 2
|
Posted: Thu Mar 25, 2010 6:01 am Post subject: CSV questions |
|
|
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 |
|
 |
ftack Moderator


Joined: 27 Jan 2003 Posts: 3102 Location: Belgium
|
Posted: Thu Mar 25, 2010 6:11 am Post subject: |
|
|
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 |
|
 |
colette Newbie

Joined: 25 Mar 2010 Posts: 2
|
Posted: Thu Mar 25, 2010 8:35 am Post subject: |
|
|
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 |
|
 |
ftack Moderator


Joined: 27 Jan 2003 Posts: 3102 Location: Belgium
|
Posted: Thu Mar 25, 2010 9:04 am Post subject: |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Thu Mar 25, 2010 1:49 pm Post subject: |
|
|
| 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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Mar 25, 2010 3:14 pm Post subject: |
|
|
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 http://forum.openoffice.org |
|
| Back to top |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Sat Mar 27, 2010 6:17 am Post subject: |
|
|
| 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 |
|
 |
|