AnsweredAssumed Answered

Extract a piece of a string and work with it (PI AF attributes)

Question asked by manuphh on Jul 2, 2015
Latest reply on Jul 3, 2015 by manuphh

Good morning mates, I have a problem which I do not know how to solve in PI AF 2014 R2.

 

I have an attribute that is a string, for example:

 

XXXXX:CONNECTED:XX

XXXXXXX:DISCONNECTED:XX

 

          Where X are numbers, sometimes more numbers and sometimes less (so the number of chars is variable)

 

I want to read this string and make a new attribute:

 

- If it is connected, the value will be 1.

- If it is disconnected, the value will be 0.

 

My problem is that I do not know any function in PI to do this. I have tried several things but I get nothing.

 

Any ideas? I think this issue could be useful to everybody.

 

Thanks a lot for your help.

Outcomes