How to extract data from a file of type .ods

I want to extract one the content of cell A1 from a .ods file.
This value is being updated every 5s. I am able to extract the value from the cell from the last saved version of the file. However, when the value is updated, I want to be able to extract that updated value.

You could use a Watch node to tell you when the file has been updated and use that to trigger the read.

Hello Colin. Thanks for the reply.
I have tried to use the watch node. However, I am getting an error.


image

The error is because the Watch node should be configured to watch a directory, not an individual file.

I use it to watch individual files.

Which node is that coming from? Hover over it and the node should highlight. Even better give your nodes names.

[Edit] If it is coming from the Excel node then it is probably that the flow is responding too quickly to changes and trying to read the file while it is still being updated. Try putting a Trigger node between the watch and the excel node set to Send Nothing then Send Original Message after 2 seconds and select Extend Delay on new messages. The two seconds will allow for the file update to complete.

that error is coming from the watch node

That is odd, it works fine for me. What version of node-red are you using? Also what version of nodejs. Run node -v to find that.

I am using version 12.16.3
I have tried using the trigger node with the configurations as requested. I still receive the same error.

v1.0.5 for node red
v12.16.3 for nodejs

I think you have selected Watch Subdirectories in the Watch node, and it is complaining that the ods file is not a directory. Uncheck that checkbox.

I have unchecked it. no error comes after i have deployed. However, I do not see any data appearing on my debug node

Have you put a debug node on the output of the watch node to see if anything is coming out? Whenever something is not working then use debug nodes to work out where it is going wrong.

Yes i have tried to put a debug node at the output of my watch node and nothing comes out. I have realised that everytime I save and close my .ods file, the latest value gets updated in my node-red. However, I would like this to be done automatically without me needing to open and close the .ods file

I might be trying to do something that it impossible to do. the value from the .ods file that I want to extract is a value that is calculated from an external .xlsx file. Because of this, the value will only be updated everytime I open the .ods file. If I don't open it, the value stays as its last updated value. I am trying to find another way around this. Thanks for the help.

Perhaps you can go direct to the external data source.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.