How to get from writer table with images to database

Hi,
I am trying to find a way to move a table with data and images in a writer file to a database (base or any other form/tool to later being able further process the records - including the pictures).

Thank you for any kind of help on this.

kr,
martin

Most people recommend that you don’t save the pictures inside the database table, to reduce file size and also to reduce the risk of data loss in case the database file gets damaged. Instead of saving the picture in the table, save the file name, with or without the file path (it makes sense to keep all pictures in a single folder, in which case you don’t need the file path in each record - unless you have really many pictures, and you want to sort them in some way and have each category in its own folder).

Thank you for your comment.
I have realized that this needs to be done first. You are describing the process which I would like to automate due to the large number of images (~ 1400) involved.
I could not yet find a tool supporting/automating this step.

Here’s a wild guess that may or may not work: Save the file as an HTML file. With some luck (I didn’t test it), the pictures will be saved separately with links to them in the HTML file. You will then have a table structure with the information and file names instead of the pictures. Then you need to convert that to csv format.

Thank you for the hint! That worked. The filenames did not show in calc but after some clean up in the html file with sed I got what I wanted.

To show the community that your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers.

One big difference to tables in Calc or Writer is the necessity to define types for the columns of the Table and ALL rows have to obey this constraint.

So: Create a new database first, then in the tables pane you can define a new table.

To be able to edit the table you need a column with an unique key/id. A common approach is to have an Id column with an autoincremented value.

However I would copy the contents of the table to a new spreadsheet first and replace the pictures by the filenames of saved pictures.
If you have columns containing date and/or time you should think about the right format to store this in your database. The conversion may be done in Calc. The Id can be left empty.

After everything seems right you mark the whole table, copy to clipboard, select the Destination table in base and select paste from the context-menu. In the opening dialog you choose to append to the existing table and can then even select the imported columns.
The last big step(s) is creating forms for editing the table.

This is only a rough outline. Don’t underestimate this step. And, if you need access to your data by several people/computers you may need to install another database like mysql first, as the internal HSQLDB is not for multiuser-access at the same time…

J.

Thank you for helping.
I cannot follow your suggestions yet:

  • You are saying "… difference to tables in Calc or Writer is the necessity to define types for the columns of the Table … ". I know that you can e.g. define the data format in calc while this is not possible in writer I guess - is that what you mean?

  • The pictures are embedded in the table of the writer document. I have found a tool to extract them but I cannot replace them with the link - this does not seem to work with that extension since Writer 6.1 - i am using 6.4.7.2.

  • You are suggesting to “… copy the contents of the table to a new spreadsheet first …”. I could not find a way where the embedded pictures could be pasted into a calc sheet, while all other data is copied, the images are not.

I’m reviving this topic because it is exactly what I’m trying to do. I have a table in Writer which I need to convert to Base. I’ve set up a table in Base to receive the information, and I’m working on getting the number of columns to match because at the moment they don’t (it was late last night when I set up the table in Base, don’t judge me! LOL) Is migrating the information over as simple as copying and pasting? Also, what is the process for getting the image file names to copy over? It doesn’t look like the last question in this topic got answered.
I’m using LibreOffice 6.0.4.2.

Absolutely not. It involves far more than that.

Well… to answer part of my own question… no it’s not that easy. I started by copying just the top three lines of my Writer table, rather than the entire 1,274 lines. Figured it would go faster.

It had asked me when I set up the table if I wanted a primary key field for indexing, which would be an auto-incrementing value, and I included that, but hadn’t included a column for that in my Writer table, so immediately my columns didn’t line up. Backed out and removed that field, and tried again (figured I can always put it back in later.)

Got an error message saying “Wrong data type: java.lang.IllegalArgumentException Continue anyway?” I said yes.

One of the fields should have had a date in it, but it was empty. Went back to the Writer table and changed the date format on those three lines from mm/dd/yyyy to mm-dd-yyyy, and tried again. No difference.

I also included links in my Writer table to the images in a folder on my hard drive. At first I didn’t have that, but included it in my second try – both times it just shows [OBJECT] in that field, so I don’t know if that information is going through or not.

I’m going to need to add more fields once I get the table uploaded – a description field and tag fields for each entry, which I’m not including in the Writer table because it’s already cumbersome. Any help I can get with this whole process would be very much appreciated!

Lori
(For the record, I used to use dBase/dBxl back in the late '80s, early '90s, but haven’t used a database since about 1996, so I’m rusty but not completely uninformed.)

Yes, I’m realizing that. Can you give me more information? Or point me to where I can find out how to do it?

There is the guide to base avavailable at LibreOffice.org, but I would suggest to create a reduced copy of your table - just the first 10 lines, then upload here to check on your data first.
If you already created a .odb, please also upload this.
.
Date is often a problem, because there are different possibilities to store them. In a Writer-table I’d assume they are simply text and not converted on import to base.