ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
Re: [ECS] Reading a text file into a number
Don Stephens
Fri, 3 Mar 2000 06:18:22 -0800
Fri, 3 Mar 2000 06:18:22 -0800
A.J.

You would have to convert the text to a number. (Where is Michael David when you need
him?) One way, awkward I admit, would be to create an Event that does something like
this

IF Text-Temp         Is      30Degrese
Then Num-Temp    Is      30

and so on. I think TV Parse refers to TVL.TXT

Don
  ----- Original Message ----- 
  From: A.J. Griglak 
  To: ECS List 
  Sent: Thursday, March 02, 2000 10:06 PM
  Subject: [ECS] Reading a text file into a number


  Can someone please explain how to read a text file into a Number Item in ECS???
   
  I have been looking at the TVL Parse event that's in Example.CFG and for the life
of me can't figure it out!!!
   
  I have a text file called cur temp.txt that holds the current temperature, parsed
from weather.com.  It looks like this:
   
  36degrees
   
  I would like to have an Item in ECS that is of type number that I can do something
like
   
  If       cur temp#        IS LT     32
  Then  msg:It's Cold   Set        Speak
   
  I just don't get the Set/Char operator and all the 
   
  Do   Character-A    Set/Char    Text-A
   
  lines...
   
  Also, where in the Event TVL Parse is the actual filename of the text file??
   
  Clueless,
  -=A.J.
   
   


A.J.
 
You would have to convert the text to a number. (Where is Michael David when you need him?) One way, awkward I admit, would be to create an Event that does something like this
 
IF Text-Temp         Is      30Degrese
Then Num-Temp    Is      30
 
and so on. I think TV Parse refers to TVL.TXT
 
Don
----- Original Message -----
From: A.J. Griglak
To: ECS List
Sent: Thursday, March 02, 2000 10:06 PM
Subject: [ECS] Reading a text file into a number

Can someone please explain how to read a text file into a Number Item in ECS???
 
I have been looking at the TVL Parse event that's in Example.CFG and for the life of me can't figure it out!!!
 
I have a text file called cur temp.txt that holds the current temperature, parsed from weather.com.  It looks like this:
 
36degrees
 
I would like to have an Item in ECS that is of type number that I can do something like
 
If       cur temp#        IS LT     32
Then  msg:It's Cold   Set        Speak
 
I just don't get the Set/Char operator and all the
 
Do   Character-A    Set/Char    Text-A
 
lines...
 
Also, where in the Event TVL Parse is the actual filename of the text file??
 
Clueless,
-=A.J.
 
 

  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.