on 01-22-2015 6:35 AM
Hi Experts,
I want a formula to capture a part of the string.
In a below line of strings i want to capture the part of text present within ( ) starting from right side of the string.
Thanks
Hi,
Are those 3 lines will be 3 separate records? If so, try creating a formula with below content:
stringVar temp:= <your field with string value>;
stringVar temp1 := StrReverse(temp);
stringVar temp2:= mid(temp1, instr(temp1, ')')+1);
strReverse(left(temp2, instr(temp2,'(')-1))
Hope this is what you are looking for.
Thanks,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghavendra,
I tried using the formula given by you but am getting desired output.
i will explain my requirement once again.
In the below line i want to query the content between ( ) starting from right side.
File(mor_cdr) monitor on SUFW03(TZ-Comviva-SUFW-172.27.55.166):NORMAL
Please help me.
Thanks.
Hi,
I presume as per your original posting that, you want to extract TZ-Comviva-SUFW-172.27.55.166 from File(mor_cdr) monitor on SUFW03(TZ-Comviva-SUFW-172.27.55.166):NORMAL.
And I see that I am getting the extracted string value if I use the formula content I had provided earlier.
Let me explain further on the steps:
1. I created a formula with content as below (say formula name is string_val)
"File(mor_cdr) monitor on SUFW03(TZ-Comviva-SUFW-172.27.55.166):NORMAL"
2. I created another formula (say required_val) with below content:
stringVar temp:= @string_val; //@string_val contains the string value as in step 1.
stringVar temp1 := StrReverse(temp);
stringVar temp2:= mid(temp1, instr(temp1, ')')+1);
strReverse(left(temp2, instr(temp2,'(')-1))
3. I see that I am getting TZ-Comviva-SUFW-172.27.55.166 as output from required_val formula which is created in step 2.
Can you post what you are getting from the formula with content created in step 2?
Thanks,
Raghavendra
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.