0

I have table like this:

and a bunch of CSV files like this:

enter image description here

in per-patient directories.

Please note that I need to take a Patient field from path name and Date from file name (as you see).

What is the easiest way to import all data in one shot?

Please note that shell programming, sed and similar things do not scary me. If really necessary I can even overcome my deep revulsion to Visual Basic and the likes.

1 Answer 1

1

The CSV files you describe are not yet ready for insertion into a database. So first, write a script or use shell commands to create a single CSV file containing all records that need to go into the BloodTestResults table, reading the appropriate values from the path and filename.

Then open the CSV file with Calc and move it into Base as explained at https://help.libreoffice.org/Common/Importing_and_Exporting_Data_in_Base.

Another approach would be to write a Python-UNO macro to read the CSV files and execute SQL insert commands. I would recommend Python rather than Basic for this type of task because file handling and regular expressions are easier.

EDIT:

It sounds like you are comfortable with Java, so that may be a good choice for you even though it's not scripting. For Java, it will help if you are comfortable with an IDE such as Eclipse or NetBeans. You can run code from the IDE to interact with LibreOffice.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .