# Read and Write .dat files

**URL:** <https://discourse.nodered.org/t/read-and-write-dat-files/40774>\
**Category:** Developing Nodes\
**Created:** [10 February 2021 18:57 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774 "2021-02-10T18:57:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hederson2801](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hederson2801](https://discourse.nodered.org/u/hederson2801)\
**Post date:** [10 February 2021 18:57 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/1 "2021-02-10T18:57:39Z")

</div>

Hello guys, I need to read and write information in the .dat file. This file has a programming in C language. In it I have variables and logic. I would like to know if there is a way to read this file from a location on my computer, and change the values ​​of a variable. For example.

read

bool position = true

write

bool position = false.

There is a node for this?

---

<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:** [10 February 2021 21:02 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/2 "2021-02-10T21:02:15Z")

</div>

Assuming the file is on the machine running node red (which may not be the one the browser is running in) then you can use a File In node to read the file, then make whatever changes you want and write it again using a File Out node.

---

<div class="post-metadata">

**Author:** ![hederson2801](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hederson2801](https://discourse.nodered.org/u/hederson2801)\
**Post date:** [12 February 2021 15:06 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/3 "2021-02-12T15:06:35Z")

</div>

Do you show me make do this? Please

Tks

---

<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:** [12 February 2021 15:24 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/4 "2021-02-12T15:24:33Z")

</div>

The fact that you have to ask this makes me think you must be a beginner with node-red. If so then I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![hederson2801](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hederson2801](https://discourse.nodered.org/u/hederson2801)\
**Post date:** [12 February 2021 16:40 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/5 "2021-02-12T16:40:35Z")

</div>

Thaks for you help. I am watch this playlist

---

<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:** [12 February 2021 16:44 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/6 "2021-02-12T16:44:22Z")

</div>

I notice that you stopped replying on [your earlier thread](https://discourse.nodered.org/t/constant-variable-in-the-graph-is-not-updated/40318), leaving it unsolved. If you found the cause of the problem you should post it on that thread so that others who find it may be helped.

---

<div class="post-metadata">

**Author:** ![hederson2801](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@hederson2801](https://discourse.nodered.org/u/hederson2801)\
**Post date:** [12 February 2021 17:04 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/7 "2021-02-12T17:04:00Z")

</div>

Yes Colin, thanks for you reminder.

Best regards

---

<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:** [13 April 2021 17:04 UTC](https://discourse.nodered.org/t/read-and-write-dat-files/40774/8 "2021-04-13T17:04:27Z")

</div>

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