# How to read file line by line

**URL:** <https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931>\
**Category:** General\
**Created:** [12 July 2020 04:09 UTC](https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931 "2020-07-12T04:09:25Z")\
**Posts on this page:** 3\
**Page:** 2

<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:** [25 July 2020 10:14 UTC](https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931/21 "2020-07-25T10:14:21Z")

</div>

> [@Steve-Mcl](#):
>
> Does the msg contain the contents you sent into the MQTT out node?

Yes, and any node written should, I believe, follow that convention.

---

<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:** [25 July 2020 10:17 UTC](https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931/22 "2020-07-25T10:17:25Z")

</div>

> [@AnusudhanK7](#):
>
> Is there any way that i can check the MQTT connection exist or not before pushing the data to the server.

Yes, using the Status node as Dave suggests, however you must still allow for the fact that there is allways the possibility of the connection failing between checking the status and sending the message to the MQTT node.

---

<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:** [23 September 2020 10:17 UTC](https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931/23 "2020-09-23T10:17:28Z")

</div>

Closed on 23 September 2020 10:17 UTC

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

[Previous page](https://discourse.nodered.org/t/how-to-read-file-line-by-line/29931.md?page=1)
