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:
[ECS] Reading a text file into a number -Reply
Brad Chamberlain
Fri, 03 Mar 2000 09:48:50 -0500

A.J. - I can help you a little. See the comment below about the set/char
below

Brad

>>> "A.J. Griglak" <aj@griglak.com> 03/03/00 01:06am >>>
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

(A.J.)

Here's an example. Basically the set/char starts at the first character and
reads it in to what you set it to. Assume in the example below that
Omni_text contains the word dog. The first time you run set/char it would
take character one of dog (d) and put it into omni_char. The second
time you run set/char it would take character 2 of dog (o) and put it into
omni_char1. The final time set/char is run it would put g into omni_char2.
Now that you have read in dog, you can dump it back into another item
using the redefine text command and compare to another item. At this
point it is text and not a number item, but hopefully this will help you
understand the set/char command. 

> Do         omnii_char           Set/Char   Omni_text
> Do         omnii_char1           Set/Char   Omni_text
> Do         omnii_char2           Set/Char   Omni_text
> Do         Test_text            Set        Re-Define Text
> Do         Test_text            Set        omnii_char
> Do         Test_text            Set        omnii_char1
> Do         Test_text            Set        omnii_char2
> If         Test_text            Is/T1      Omni_Temp_Compare

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
.