This content has been marked as final. Show 5 replies
I managed to do it like this:
<cfif Isdefined("qtest.wMNAMEUser") AND #Len(Trim(qtest.wMNAMEUser))# NEQ 0>
<cfset pnr = RemoveChars(qtest.wMNAMEUser, 1, 3)>
<cfset aantal = Len(Trim(pnr))>
<cfset nr = aantal - 20>
<cfset pnr = Left(pnr, nr)>
<!--- <cfset pnr = RemoveChars(Right(aantal, 1, 20))> --->
However I saw that the right part of the value is not always 20 characters long. So it all becomes a little bit moere difficult.
This is an example of an total value returned by the query:
cn=P122356,ou=staff,o=RUG,c=NL [I want the P122356 here]]
You can see the total value of characters differs, the first three are always the same and they have to be removed, but the last characters [till the last character of the value I need] is not always the same lenght.
Is it even possible to get the right values [the value between: "cn=" and ",ou="]?
Hopefully soemone can help me a little bit with this.
Remove the first three characters and then treat the remaining string as a list.
<CFSET nr = Mid(qtest.wMNAMEUser,4,Len(qtest.wMNAMEUser)-20)>
Hope this is what you needed?
Cheers / Manu.
We answered this question awhile ago in there forums, what happened?
Yes I'm sorry. I actually already have [and used] a script where this works.... a little bit overworked, not very awake yesterday....
Here's the post you mean:
This is maybe helpfull to others.