# Read file by external modules

**URL:** <https://discourse.nodered.org/t/read-file-by-external-modules/82016>\
**Category:** Industrial\
**Created:** [13 October 2023 23:36 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016 "2023-10-13T23:36:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_1711](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Mohamed\_1711](https://discourse.nodered.org/u/Mohamed_1711)\
**Post date:** [13 October 2023 23:36 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/1 "2023-10-13T23:36:41Z")

</div>

How can I read file by external modules?  
Can anyone ge be steps with supported json file ??

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 October 2023 11:05 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/2 "2023-10-14T11:05:43Z")

</div>

You will need to explain more about what you are wanting, there is nowhere near enough to go on here.

---

<div class="post-metadata">

**Author:** ![Mohamed\_1711](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Mohamed\_1711](https://discourse.nodered.org/u/Mohamed_1711)\
**Post date:** [14 October 2023 12:58 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/3 "2023-10-14T12:58:32Z")

</div>

I have txt file that I want to read its content but I don't want to use node of read file. And I will search on specfics words in this content file.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 October 2023 13:19 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/4 "2023-10-14T13:19:24Z")

</div>

> [@Mohamed\_1711](#):
>
> I don't want to use node of read file. And I will search on specfics words in this content file.

Exec node and grep?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 October 2023 14:08 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/5 "2023-10-14T14:08:53Z")

</div>

> [@Mohamed\_1711](#):
>
> I don't want to use node of read file

_Something_ has to read the file in order to process it. That can either be done by reading the whole file and then processing, reading in chunks (which might be a set length or delimited - normally by line feed).

jbudd's suggestion uses an operating system app to do the read and search. The results can be used back in Node-RED. There may be some custom nodes that will do this - do a search in the Flows site. Alternatively, since Node-RED is built on Node.js, it is possible to use the Node.js `fs` library in a function node (though you will need to turn on the ability for function nodes to load external modules in the settings.js file).

Without knowing more about the file you need to read and your level of comfort with different tools, it is not possible to really help further.

---

<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:** [15 October 2023 09:11 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/6 "2023-10-15T09:11:52Z")

</div>

> [@Mohamed\_1711](#):
>
> I don't want to use node of read file

If you explain why you cannot use the built in file read node then it may help us to point you to a good solution.

---

<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:** [14 December 2023 09:12 UTC](https://discourse.nodered.org/t/read-file-by-external-modules/82016/7 "2023-12-14T09:12:49Z")

</div>

Closed on 14 December 2023 09:12 UTC

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