parsing issue

30 views
Skip to first unread message

Adrian Fretwell

unread,
Feb 23, 2018, 6:22:19 AM2/23/18
to Node-RED
Trying to extract data with function works with all objects in file (attached) excluding those with a hyphen  E-Total E-Month E-Today. 
The E becomes highlighted when creating the function
Is there a solution.

Regards Adrian 
Node red data.txt

Zenofmud

unread,
Feb 23, 2018, 6:38:13 AM2/23/18
to node...@googlegroups.com
Can you supply the function you are using?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/57a72992-a2c0-4de2-b42d-be9fc6231c69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Node red data.txt>

Colin Law

unread,
Feb 23, 2018, 7:06:40 AM2/23/18
to node...@googlegroups.com
If you are using code like msg.payload.E-total then that won't work as the minus sign will be taken to be the subtraction operator. Instead use
msg.payload["E-total"]

The dot syntax is a shorthand for ["attribute"]

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

Adrian Fretwell

unread,
Feb 23, 2018, 7:17:14 PM2/23/18
to Node-RED
Thanks for the quick response Colin and Paul.  The bracketed quotes works 
Reply all
Reply to author
Forward
0 new messages