An easy way to delete duplicates form a list is to loop the list into a
structure using the list item as the key then use structKeyList() to get the
cleaned list back out

I don't know what your initial list looks like but here is an example with a
space delimited list...

<cfset theList = "9969593 9969593 9969599 9969599 9969594 9969594 9969600
9969600 9969599 9969599" />
<cfset uniqueListItems = structNew() />

<cfloop list="#theList#" delimiters=" " index="i">
        <cfset uniqueListItems[i] = i />
</cfloop>

<cfset cleanedList = structKeyList(uniqueListItems) />

..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com


-----Original Message-----
From: morchella [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 21, 2008 3:57 PM
To: CF-Talk
Subject: Re: delete duplicates.

all that seems to do is to remove the commas?

<cfoutput query="getAce" group="title">
#title# x<br />
<cfloop From = "1" To = "#ListLen(getAce.specs_partnum)#" index = "Counter">
    <cfoutput group="specs_partnum">
    <cfset acccL = #ListGetAt(getAce.specs_partnum,Counter)#>
    <cfset acccL = '#acccL#,'>
    #ListDeleteDuplicates(acccL)#
        </cfoutput></cfloop> <br /><br />
</cfoutput>

Cable Management x
9969593, 9969593, 9969599, 9969599, 9969594, 9969594, 9969600, 9969600,
9969599, 9969599, 9969601, 9969601, 9969600, 9969600, 9969928, 9969928,
9969601, 9969601, 9969927, 9969927, 9969928, 9969928, 9969597, 9969597,
9969927, 9969927, 9969736, 9969736, 9969597, 9969597, 9969595, 9969595,
9969736, 9969736, 9969598, 9969598, 9970253, 9970254, 9970255, 9970256,
9970263, 9970264, 9970265, 9970266, 9970271, 9970271, 9970271, 9970271,

Cable Management x
9969593 9969593 9969599 9969599 9969594 9969594 9969600 9969600 9969599
9969599 9969601 9969601 9969600 9969600 9969928 9969928 9969601 9969601
9969927 9969927 9969928 9969928 9969597 9969597 9969927 9969927 9969736
9969736 9969597 9969597 9969595 9969595 9969736 9969736 9969598 9969598
9970253 9970254 9970255 9970256 9970263 9970264 9970265 9970266 9970271
9970271 9970271 9970271




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305853
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to