# How to extract data from a file of type .ods

**URL:** <https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300>\
**Category:** General\
**Created:** [1 July 2020 10:32 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300 "2020-07-01T10:32:10Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 10:32 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/1 "2020-07-01T10:32:10Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aa74d15e242ffdbbd75472ddf7127eac5f1036cd.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 10:55 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/2 "2020-07-01T10:55:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 11:08 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/3 "2020-07-01T11:08:17Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/df3f0d75a23038db70d479be81b137e42b99da3c.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/50e0188f22274af076283158cbc09cee004977d4.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 July 2020 11:22 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/4 "2020-07-01T11:22:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 11:30 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/5 "2020-07-01T11:30:12Z")

</div>

I use it to watch individual files.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 11:36 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/6 "2020-07-01T11:36:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 11:42 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/7 "2020-07-01T11:42:31Z")

</div>

that error is coming from the watch node

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 11:46 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/8 "2020-07-01T11:46:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 11:49 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/9 "2020-07-01T11:49:34Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3da5268e62da3c80bf90ed3daec5cbda692244f.png)

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 11:51 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/10 "2020-07-01T11:51:07Z")

</div>

v1.0.5 for node red  
v12.16.3 for nodejs

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 12:51 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/11 "2020-07-01T12:51:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [1 July 2020 14:27 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/12 "2020-07-01T14:27:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 July 2020 14:55 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/13 "2020-07-01T14:55:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [2 July 2020 03:47 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/14 "2020-07-02T03:47:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eddy23](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@eddy23](https://discourse.nodered.org/u/eddy23)\
**Post date:** [2 July 2020 04:17 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/15 "2020-07-02T04:17:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 July 2020 05:58 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/16 "2020-07-02T05:58:52Z")

</div>

Perhaps you can go direct to the external data source.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [31 August 2020 05:59 UTC](https://discourse.nodered.org/t/how-to-extract-data-from-a-file-of-type-ods/29300/17 "2020-08-31T05:59:03Z")

</div>

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