How to dynamically update a LibreOffice spreadsheet from file?

I have a CSV file with data I want in a spreadsheet - mostly to display a chart based on it. I also want the chart to be updated every time the file is rewritten by a console application. What I tried already:

  1. Open it in Calc, then rewrite it on disk. Impossible due to Calc locking the file.
  2. Played with shared spreadsheets in Calc. Did not help much.
  3. Tried to set it up through LO Base. LO Base does not lock the database source but refuses to update its table view anyway. The Refresh/Reload button does nothing.

Any suggestions?


Solution 1:

In Calc choose your file via menu Sheet > Link to External Data..., check update every x seconds with value that you want. Browse for your CSV file. Check choosen encoding. Works for me. Without any reloading.

My Sheet looks like:

| A | B | C |
|---|---|---|
| 1 | 2 | 3 |

My external.csv:

4,5,6

After execute Link... from menu additional row wave been added and Sheet

| A | B | C |
|---|---|---|
| 1 | 2 | 3 |
| 4 | 5 | 6 |

Add data to the file with echo "7,8,9" >> external.csv and I've got another row in Sheet.

Change the file sed -i '' 's/9/0/' external.csv and Sheet

| A | B | C |
|---|---|---|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 0 |