# Time Check From 2 csv files

**URL:** <https://discourse.nodered.org/t/time-check-from-2-csv-files/57115>\
**Category:** General\
**Created:** [23 January 2022 19:54 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115 "2022-01-23T19:54:58Z")\
**Posts on this page:** 14\
**Page:** 4

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [30 January 2022 14:06 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/61 "2022-01-30T14:06:29Z")

</div>

> [@mikey](#):
>
> i was trying against wrong col...

easy fix for this  
in CSV node instead of leaving the Columns field empty .. which will default to col1, col2, col3 ..  
add the names of the Columns .. comma seperated

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/80d6050c07fd9c67693fa786a2d2e7ea622d2dac.png)

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [30 January 2022 14:22 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/62 "2022-01-30T14:22:17Z")

</div>

changed that ty

```auto
{"warn":"6.6","high":"6.3","low":"5.4","dose":"5.2","log":{"time":"2022-01-30 09:15:00","%":"ppm500","F":"F","Ppm":1630,"Ph":5.9,"Temp":71}}

```

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [30 January 2022 21:46 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/63 "2022-01-30T21:46:14Z")

</div>

```auto
[{"id":"c70d5be49b4d2a61","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"ae7cf6a489b7ad36","type":"file in","z":"c70d5be49b4d2a61","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":1830,"y":620,"wires":[["32d8ddc9f7e7179e"]]},{"id":"2f2ed224c4744c97","type":"function","z":"c70d5be49b4d2a61","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2200,"y":620,"wires":[["07285056079b915d"]]},{"id":"fb2fc7b6be6fd7a4","type":"join","z":"c70d5be49b4d2a61","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2070,"y":620,"wires":[["2f2ed224c4744c97"]]},{"id":"32d8ddc9f7e7179e","type":"csv","z":"c70d5be49b4d2a61","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":1950,"y":620,"wires":[["fb2fc7b6be6fd7a4"]]},{"id":"ac71b1021741bdaf","type":"api-current-state","z":"c70d5be49b4d2a61","name":"dose","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_dose","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"dose","valueType":"str"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2330,"y":380,"wires":[["cffd6e459ae1e3f4"]]},{"id":"6f2d57c0407125a7","type":"api-current-state","z":"c70d5be49b4d2a61","name":"low","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_low","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"low","valueType":"str"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2330,"y":440,"wires":[["cffd6e459ae1e3f4"]]},{"id":"6f2f31264ee251da","type":"api-current-state","z":"c70d5be49b4d2a61","name":"high","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_high","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"high","valueType":"str"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2330,"y":500,"wires":[["cffd6e459ae1e3f4"]]},{"id":"4595d91c0b6d957b","type":"api-current-state","z":"c70d5be49b4d2a61","name":"warn","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_warn","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"warn","valueType":"str"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2330,"y":560,"wires":[["cffd6e459ae1e3f4"]]},{"id":"cffd6e459ae1e3f4","type":"join","z":"c70d5be49b4d2a61","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2490,"y":620,"wires":[["4e2edfae8f0bc7bd"]]},{"id":"4e2edfae8f0bc7bd","type":"switch","z":"c70d5be49b4d2a61","name":"","property":"payload.log.col5","propertyType":"msg","rules":[{"t":"gte","v":"payload.warn","vt":"msg"},{"t":"btwn","v":"payload.low","vt":"msg","v2":"payload.high","v2t":"msg"},{"t":"lte","v":"payload.dose","vt":"msg"}],"checkall":"false","repair":true,"outputs":3,"x":2610,"y":620,"wires":[["552ea4cb7aabe04e"],["529f5ae2ce49085e"],["6009a108c948f0b2"]]},{"id":"07285056079b915d","type":"change","z":"c70d5be49b4d2a61","name":"SMC","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.log.col5","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"log","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2330,"y":620,"wires":[["cffd6e459ae1e3f4"]]},{"id":"464aa6c7611abc5c","type":"inject","z":"c70d5be49b4d2a61","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"360","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":490,"y":640,"wires":[["130ca3465c6bd26f","83e7f26f03c0d38a","7e5fcb5dd6ef1686"]]},{"id":"83e7f26f03c0d38a","type":"file in","z":"c70d5be49b4d2a61","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":630,"y":640,"wires":[["f3a37e3d36a20f63"]]},{"id":"80228cf2058f30cb","type":"function","z":"c70d5be49b4d2a61","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":640,"wires":[["a558317529cb7a1a"]]},{"id":"a72693d373bf28f1","type":"join","z":"c70d5be49b4d2a61","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":640,"wires":[["80228cf2058f30cb"]]},{"id":"f3a37e3d36a20f63","type":"csv","z":"c70d5be49b4d2a61","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":750,"y":640,"wires":[["a72693d373bf28f1"]]},{"id":"130ca3465c6bd26f","type":"moment","z":"c70d5be49b4d2a61","name":"","topic":"Ctime","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYYMMDDHHmm","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":1310,"y":600,"wires":[["0818f3b9029fcd7c"]]},{"id":"40d79082eff83879","type":"function","z":"c70d5be49b4d2a61","name":"payload","func":"var content1 = msg.payload[0];\nvar content2 = msg.payload[1];\n\n{\nmsg.payload = (content1 - content2)\n}\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1580,"y":620,"wires":[["9728e7a5e3d99861"]]},{"id":"0818f3b9029fcd7c","type":"join","z":"c70d5be49b4d2a61","name":"","mode":"custom","build":"object","property":"topic","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1450,"y":620,"wires":[["40d79082eff83879"]]},{"id":"a558317529cb7a1a","type":"change","z":"c70d5be49b4d2a61","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.col1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":640,"wires":[["6409cae3ba313d5e"]]},{"id":"6409cae3ba313d5e","type":"moment","z":"c70d5be49b4d2a61","name":"","topic":"ftime","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYYMMDDHHmm","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":1310,"y":640,"wires":[["0818f3b9029fcd7c"]]},{"id":"9728e7a5e3d99861","type":"switch","z":"c70d5be49b4d2a61","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"},{"t":"gte","v":"3","vt":"num"}],"checkall":"false","repair":true,"outputs":2,"x":1710,"y":620,"wires":[["ae7cf6a489b7ad36","4595d91c0b6d957b","6f2f31264ee251da","6f2d57c0407125a7","ac71b1021741bdaf"],["459669f03e08c4a6"]]},{"id":"552ea4cb7aabe04e","type":"api-call-service","z":"c70d5be49b4d2a61","name":"ch8 on","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2730,"y":600,"wires":[["da5ce3213535c928"]]},{"id":"3229c0e4791e3d8a","type":"api-call-service","z":"c70d5be49b4d2a61","name":"ch8 off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3690,"y":600,"wires":[["158f904138bb7ad9"]]},{"id":"158f904138bb7ad9","type":"change","z":"c70d5be49b4d2a61","name":"1123","rules":[{"t":"set","p":"payload","pt":"msg","to":"System Msg (1123): Ph went under 5.4, doser has been activated. Check status ASAP","tot":"str","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":3850,"y":600,"wires":[[]]},{"id":"529f5ae2ce49085e","type":"change","z":"c70d5be49b4d2a61","name":"1133","rules":[{"t":"set","p":"payload","pt":"msg","to":"System Msg(1133): Conditions are Optimal","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3850,"y":660,"wires":[["10e074596f4698d6"]]},{"id":"342242aec7fd9232","type":"change","z":"c70d5be49b4d2a61","name":"1143","rules":[{"t":"set","p":"payload","pt":"msg","to":"System Msg(1143): Pump or probe may need attention","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3850,"y":700,"wires":[["10e074596f4698d6"]]},{"id":"6009a108c948f0b2","type":"api-call-service","z":"c70d5be49b4d2a61","name":"ch8/off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3690,"y":700,"wires":[["342242aec7fd9232"]]},{"id":"aa0dee78c20d88f8","type":"change","z":"c70d5be49b4d2a61","name":"1111","rules":[{"t":"set","p":"payload","pt":"msg","to":"System Msg(1111) Time is incorrect. ALL Channels Have Been Shutdown!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3850,"y":760,"wires":[["10e074596f4698d6"]]},{"id":"da5ce3213535c928","type":"api-current-state","z":"c70d5be49b4d2a61","name":"ph up","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_up","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2970,"y":600,"wires":[["fe9de429aca99b54"]]},{"id":"fe9de429aca99b54","type":"calculator","z":"c70d5be49b4d2a61","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"div","constant":"0.83","round":false,"decimals":0,"x":3110,"y":600,"wires":[["bac5a26806b565ef"]]},{"id":"d0c03ec7cdef8946","type":"change","z":"c70d5be49b4d2a61","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3400,"y":600,"wires":[["55ecdb92325a24a0"]]},{"id":"55ecdb92325a24a0","type":"delay","z":"c70d5be49b4d2a61","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3560,"y":600,"wires":[["3229c0e4791e3d8a"]]},{"id":"bac5a26806b565ef","type":"calculator","z":"c70d5be49b4d2a61","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"mult","constant":"1000","round":false,"decimals":0,"x":3240,"y":600,"wires":[["d0c03ec7cdef8946"]]},{"id":"459669f03e08c4a6","type":"change","z":"c70d5be49b4d2a61","name":"time is out of range","rules":[{"t":"set","p":"payload","pt":"msg","to":"Time Check Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3410,"y":720,"wires":[["aa0dee78c20d88f8"]]},{"id":"0014a165d02ced5c","type":"file","z":"c70d5be49b4d2a61","name":"BlueLogs","filename":"/config/BlueLogs.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":4160,"y":820,"wires":[["82cb39a857cddc90"]]},{"id":"10e074596f4698d6","type":"csv","z":"c70d5be49b4d2a61","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":4030,"y":820,"wires":[["0014a165d02ced5c"]]},{"id":"82cb39a857cddc90","type":"debug","z":"c70d5be49b4d2a61","name":"file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4290,"y":820,"wires":[]},{"id":"7e5fcb5dd6ef1686","type":"moment","z":"c70d5be49b4d2a61","name":"T.stamp","topic":"timestamp","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":3560,"y":560,"wires":[["10e074596f4698d6"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

```

@unborn this works start to finish

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [1 February 2022 10:52 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/64 "2022-02-01T10:52:33Z")

</div>

@UnborN just wanted to thank you for all your help and guidance with node red, I seriously could not of crossed the finish line without your knowledge of this system and i truly appreciate it. Your swift intelligent responses that gave me direction when it was most needed. Im sure youll hear from me again with a "everything is lost" post but atm all systems are running as expected

```
                                                                                                   With utmost respect,
                                                                                                                                 Mikey
```

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [1 February 2022 13:35 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/65 "2022-02-01T13:35:23Z")

</div>

You are welcome. We all started Node-red the same way.  
Experimenting, trying different things, reading on the Forum.  
Every problem is a challenge and thats what makes programming fun.

I dont know if you already did but there is an introductory video playlist done by the developers of Node-red.  
im sure you gonna up a trick or two  
[Node-RED Essentials](https://www.youtube.com/watch?v=ksGeUD26Mw0&list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6)

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 10:52 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/66 "2022-02-03T10:52:17Z")

</div>

on script runs twice then returns to normal on the 3rd process, even tho the 2nd time it runs the readings are in correct range to do nothing..is this common?

i could code in a function that kills the power to the system for the period of time it takes to straighten out, but seems weird it happens twice then fine.

i tried doubling delay timer to give it more time to register but it did not work it still doubled the function.

ideas welcomed

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 13:17 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/67 "2022-02-03T13:17:30Z")

</div>

idea, use function to restart flow after "system on" is triggered

now to figure out how thats done..reading..reading..reading

can this be accomplished from the home assistant docker side of node red?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [3 February 2022 14:51 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/68 "2022-02-03T14:51:41Z")

</div>

> [@mikey](#):
>
> use function to restart flow after "system on" is triggered

that not a solution ..  
just because there is some problem in the logic of your flow it doesnt mean you have to restart it.  
its better to see what the problem is.

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 14:53 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/69 "2022-02-03T14:53:38Z")

</div>

its a hackjob fix i know

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 14:57 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/70 "2022-02-03T14:57:58Z")

</div>

its gotta be a switch issue doesnt it? i hate switches

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [3 February 2022 15:10 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/71 "2022-02-03T15:10:44Z")

</div>

you are not giving us any information in order to help

1. we dont know whats in the csv file
2. based on the last flow you shared .. i dont undertand why you read the same grogreen csv twice
3. why are there wires going across the flow from that inject node to trigger things further down.. when you could simply trigger them from the previous node ?
4. In the Function node named "payload" you use code like `content1 = msg.payload[0];`  
as if you are still trying to access elements of an array .. yet the result of the Join node (set to Key/value) will be an Object.

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 15:16 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/72 "2022-02-03T15:16:05Z")

</div>

sorry i was kinda just posting my thoughts as i was working this out, heres some info

csv it reads from:

```auto
2022-02-03 05:19:00,ppm500,F,1640,5.3,68
2022-02-03 05:20:00,ppm500,F,1630,5.3,68
2022-02-03 05:21:01,ppm500,F,1630,5.3,68
2022-02-03 05:22:00,ppm500,F,1650,5.5,68
2022-02-03 05:23:00,ppm500,F,1650,5.8,68
2022-02-03 05:24:00,ppm500,F,1650,5.9,68
2022-02-03 05:25:00,ppm500,F,1650,5.9,68
2022-02-03 05:26:00,ppm500,F,1660,5.9,68
2022-02-03 05:27:00,ppm500,F,1660,5.9,68
2022-02-03 05:28:00,ppm500,F,1660,6,68
2022-02-03 05:29:00,ppm500,F,1650,6,68
2022-02-03 05:30:00,ppm500,F,1650,6,68
2022-02-03 05:31:00,ppm500,F,1660,6,68
2022-02-03 05:32:00,ppm500,F,1660,6,68
2022-02-03 05:33:00,ppm500,F,1650,6,68
2022-02-03 05:34:00,ppm500,F,1660,6,68
2022-02-03 05:35:00,ppm500,F,1650,6,68
2022-02-03 05:36:00,ppm500,F,1660,6,68

```

out log

```auto
{"col1":"2022-02-03 05:20:20"}
{"col1":"System Msg (1132): Within Recommended Levels"}
{"col1":"System Msg (1123): Ph went under 5.4","col2":" doser has been activated. Check status ASAP"}
{"col1":"2022-02-03 05:32:20"}
{"col1":"System Msg (1132): Within Recommended Levels"}
{"col1":"System Msg (1123): Ph went under 5.4","col2":" doser has been activated. Check status ASAP"}
{"col1":"2022-02-03 05:44:20"}
{"col1":"System Msg(1133): Conditions are Optimal"}
{"col1":"System Msg (1132): Within Recommended Levels"}
{"col1":"2022-02-03 05:56:20"}
{"col1":"System Msg(1133): Conditions are Optimal"}
{"col1":"System Msg (1132): Within Recommended Levels"}
{"col1":"2022-02-03 06:08:20"}
{"col1":"System Msg(1133): Conditions are Optimal"}
{"col1":"System Msg (1132): Within Recommended Levels"}

```

you can see at 5:32 am it was within range and still activated the system

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [3 February 2022 15:31 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/73 "2022-02-03T15:31:32Z")

</div>

i wanted it to drop a time stamp in that file, it marks as like a header before each process is run i seen an easy method to inject it before anything else so i used it

i was trying something like that before but wasnt returning the file as i wanted it and this gave me the output i desired

---

<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:** [4 April 2022 15:31 UTC](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115/74 "2022-04-04T15:31:55Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/time-check-from-2-csv-files/57115.md?page=3)
