# How to get value in txt file?

**URL:** https://discourse.nodered.org/t/how-to-get-value-in-txt-file/47212
**Category:** General
**Created:** [16 June 2021 02:55 UTC](https://discourse.nodered.org/t/how-to-get-value-in-txt-file/47212 "2021-06-16T02:55:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![toantq](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@toantq](https://discourse.nodered.org/u/toantq)
#### Post date: [16 June 2021 02:55 UTC](https://discourse.nodered.org/t/how-to-get-value-in-txt-file/47212/1 "2021-06-16T02:55:24Z")

</div>

Hi everyone, I have issue that I want get data from txt file, but I not good Javascript, so I dont know how to get it,  
Example I want get value " PH = 0 " Col1 and Col2 in 0: object

 ![node-red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cca0d4dfd793bb878a8efd4dd95d8b2e2c56dfee.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [16 June 2021 07:04 UTC](https://discourse.nodered.org/t/how-to-get-value-in-txt-file/47212/2 "2021-06-16T07:04:15Z")

</div>

To concatenate strings to create `" PH = 0 "` you use the JavaScript `+` operator  
e.g...

```javascript
var string1 = "PH"; //TODO: get value from array element 0 col1
var string1 = "0"; //TODO: get value from array element 0 col2
msg.payload = string1 + " = " + string2;
return msg;

```

To populate `string1` and `string2` variables with the ACTUAL VALUES, use the copy path button (as described below) and add `msg.` to the beginning. e.g. `var string1 = msg.payload[0].col1;`

* * *

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

---

<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: [15 August 2021 07:05 UTC](https://discourse.nodered.org/t/how-to-get-value-in-txt-file/47212/3 "2021-08-15T07:05:11Z")

</div>

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