openoffice-calc

read data from multiple spreadsheets into database


I've got a whole directory of openoffice calc files, which are basically filled out versions of the exact same Template.

Now I would like to get the Data of a few cells of each file and put them into a MySQL database.

Is it possible to do this using OpenOffice Calc itself?

As this is a one-time job it does not matter how messy it gets and I would like to waste as little time on writing code as possible.

The only scripting language I have ready to use right now is PHP and I would be able to do it with PHP using a xml reader class, but I have never done that before and I don't want to waste my time on endless debugging so I figured I'd ask you guys first for better ideas.

thank you in advance


Solution

  • Just in case anybody cares, here is how I did it in the end, no scripting was needed:

    1. do Strg + A and Strg + C on the files in the folder to copy all file paths
    2. paste into first column of new spreadsheet
    3. use find&replace to replace all .ods file endings in the column with a unique placeholder
    4. paste list of files into next column and repeat 3.
    5. repeat for all columns
    6. do a find&repalace to replace "\" with "/"
    7. replace all placeholders with ".ods'#Table1.A1" where A1 stands for the cell that you want to get the data from
    8. relplace "C:/" with "='file:///C:/" this might take a few seconds to process
    9. copy everything to new file with paste special(Strg+Shift+V) so that only the values get pasted
    10. import .ods into phpmyadmin