Hi all,
I am running into an issue where, I suspect that split has the functionality and i'm simply not looking for the right thing to find the examples i'd like.
What i want is to use split like how excel works, where you can count characters to the right or left to exclude/include.
so for instance, i have a message like this:
BTF_CWING_LOW_TEMP **= 2021-11-19 14:10:55
where, i'd like to split on the left by **, but, the character 3rd in the string = could be any of a number of different characters, so, i'd like to split it at the space before 2021, but, i want to account for whatever that character is. so if i were doing this in excel, i'd count 2 to the right when splitting - does that make sense?
I look forward to your responses, and thanks for your time!
you know, i had not considered AI builder - but i could see where that might be a better option since i could train it to recognize the text i want. thanks!
I'll be honest - if you can get this done it will be really ugly... There are too many variables. For example, the data at the start of the string (Low Limit out-of-range, Alarm change-of-state ) is not consistent making it difficult to impossible to break out.
As you have suggested, you could try splitting on ** and then using a string functions to go to a certain character position, etc. If you want to go that way, you'll be using the substring(), length(), indexOf(), lastIndexOf() and trim expressions.
I'm not saying that you can't get there, but it will be a whole lot of work and what you create may not be bullet proof........
If you have a premium license, you might try exploring the use of the AI builder functionality. I suspect that using AI is a better way to go.
Sure! so, for instance, i have this message:
Low Limit out-of-range BTF_CWING_LOW_TEMP **= 2021-11-19 14:10:55
ultimately, i want to end up with:
BTF_CWING_LOW_TEMP,
**=,
2021-11-19
here is another example:
Alarm change-of-state WEL_HW__HX9_HIGH_LIMIT **& 2021-11-17 12:42:48
WEL_HW__HX9_HIGH_LIMIT,
**&,
2021-11-17
the characters in the middle - **= and **& are just a couple of examples, there are a number of special characters that could happen after ** so, i was thinking that if i were doing this in excel, i'd first split it at "-" and count 5 characters to the right, giving me:
WEL_HW__HX9_HIGH_LIMIT **& 2021-11-17 12:42:48
then i'd split it at "**" and count 1 character to the right, to give me:
2021-11-17 12:42:48
and then at "**" to the left, and trim to give me:
WEL_HW__HX9_HIGH_LIMIT
though, while writing this it occured to me that if i were to split first with a space delimiter i'd end up with:
WEL_HW__HX9_HIGH_LIMIT,
**&,
2021-11-17
in an array that i could then select elements from?
I am not 100% clear on your requirement. Can you provide a couple of examples of a string and your required output?
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2