I have decided to use LibreOffice Base for my personal project. I have a couple of csv files holding data for a database I’ve created and I would like to import them. However, I’ve run into two issues:
- I haven’t found a way to directly import a text file into a Base database. I found a workaround where I import data into Calc, select them, copy them to clipboard and then paste to Base, which opens a Copy table wizard, which lets me import copied data. It may work fine for some cases, but importing data to Calc is a problem for me. One of my files is fairly large and Calc can only hold about 1 milion rows in a sheet. One possible solution would be splitting the file into 1 milion row chunks and import them separately, but handling about 200 files sounds daunting and I am reluctant to get started. There surely is a better way, or is it? I mean, populating a database by data from a file sounds like a basic task, so I assume there is a easy way to do it. Am I right?
So, my first question is: How can I import data from a large csv file to a Base table?
- When importing data to other and smaller tables I’ve encountered another issue I’d like to ask about. I don’t have an ID record for my data, I intended to use an auto-numbered column for primary key and have Base handle the numbering for me. When importing data from Calc by copying as mentioned above, I noticed that columns in the Copy table wizard don’t align as the ID column was missing in the Calc table. I then added an empty column to the Calc table, so that it makes the other column match well and removed its tick in the wizard so it doesn’t get imported. Idea was to let Base fill the ID column with unique numbers for me. But I get an error that I’m trying to paste null values into non-nullable column and nothing gets imported.
My second question is: How can I import data from a file to a Base table which has an auto-number as its primary key?
Thanks for replies, any feedback or assistance is much appreciated!