on 07-19-2011 12:15 PM
Hi,
I am trying to use 'stringreplace' function in the expression editor to replace '\' by ',' as follows:
stringreplace("\abcd\xyz\dfjdf\asdf","\",",")
But I am facing problem replacing it,I guess it may be something because of escape character "\".
Please suggest some solution to achieve this.
Thanks
Anuj
Try
\\
for each \.
Regards,
Mike
Edited by: Michael Appleby on Jul 19, 2011 1:20 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike,
Off creating calculated tags in OSI PI wont serve my purpose.
Actually I am getting the path of each tag by firing a query in the format '\xyz\abc\pqr\' ,'\aaa\bbb\ccc\ddd\eee\fff\' etc. directly from the OLE DB.
And Chris,
I tried creating a local variable with its value as '\',but it is also not working.Giving me the same error "Invalid escape character found"
Thanks
Anuj
Hi All,
I was able to get the solution for the problem.Actually the problem was with the string value in which replacement was to be done.
What I finally did is created a Trx variable for stringValue and implemented the code as below:
stringreplace(Transaction.str,"\\",",")
e.g. str = \aaa\bbb\ccc\ddd\
output will be : ,aaa,bbb,ccc,ddd,
Thanks
Anuj
Edited by: Anuj Suryawanshi on Jul 20, 2011 11:39 AM
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.