-
1. Re: CF9 - convert LDAP data into associative array?
12Robots May 10, 2013 10:12 AM (in response to WolfShade)What is the source of the data? Is it a text file with the above data? Is it an LDAP query? Spreadsheet?
Jason
-
2. Re: CF9 - convert LDAP data into associative array?
WolfShade May 10, 2013 10:24 AM (in response to 12Robots)Hi, Jason.
Sorry.. I still haven't completely woken up, yet.
The data is in a .ldf file that resides on the server. Right now, I'm using CFFILE to read it into a string. I can also set it up for JavaScript, if that would be easier/quicker/more efficient.
^_^
-
3. Re: CF9 - convert LDAP data into associative array?
WolfShade May 10, 2013 12:50 PM (in response to WolfShade)Well.. I pushed ahead, a little, and am trying to manually create an array of arrays. But the nested array is (at least, what I _plan_ for it to be) an associative array. So I'm splitting on the colon ":" and trying to set the left value as the key and the right value as the value.
But I'm getting an error message: The value Dn cannot be converted to a number.
I've tried many things, including ToString, and I just can't seem to nail it.
^_^
-
4. Re: CF9 - convert LDAP data into associative array?
WolfShade May 10, 2013 1:00 PM (in response to WolfShade)Inside CFSCRIPT:
for(i=1; i lte arrayLen(ldap_data2); i++){ thisArray = listToArray(ldap_data2[i],"""",false); thatArray = ArrayNew(1); for(j=1; j lte arrayLen(thisArray); j++){ thatArray[ListGetAt(thisArray[j],1,':')] = thatArray[ListGetAt(thisArray[j],2,':')]; } }^_^
-
5. Re: CF9 - convert LDAP data into associative array?
WolfShade May 10, 2013 1:58 PM (in response to WolfShade)I got it partially figured out. I wasn't using the index of the array as notation. thatArray[j][ListGetAt(thisArray[j],1,':')] = is what kind of fixed it.
However, instead of having an index array of associative arrays, I have an index array of index arrays, each of which contains a single struct that just happens to be an associative struct.
Sigh.. the search continues.. suggestions greatly appreciated.
Thank you,
^_^


