We're currently migrating from Ask to Discourse, read the details here

Ask Your Question
0

How to get from writer table with images to database

asked 2021-05-05 19:35:20 +0200

martingwb gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2021-05-05 22:32:49 +0200

Wanderer gravatar image

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.

edit flag offensive delete link more

Comments

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.

martingwb gravatar imagemartingwb ( 2021-05-07 13:22:29 +0200 )edit
0

answered 2021-05-05 19:57:11 +0200

floris v gravatar image

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).

edit flag offensive delete link more

Comments

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.

martingwb gravatar imagemartingwb ( 2021-05-07 13:24:57 +0200 )edit

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.

floris v gravatar imagefloris v ( 2021-05-07 13:53:12 +0200 )edit

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.

martingwb gravatar imagemartingwb ( 2021-05-09 10:25:05 +0200 )edit

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.

floris v gravatar imagefloris v ( 2021-05-09 22:26:14 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2021-05-05 19:35:20 +0200

Seen: 29 times

Last updated: May 05