Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Lists and removing Duplicates

Status
Not open for further replies.

kloner

Programmer
May 15, 2000
79
AU
Hi all,

If I have 2 lists, and want to compare the second to the first, and if there are any duplicates I want to skip over them, but if there are new words I want to add them to the new list. How would this be done?

List 1 : a, b, c, d, e

List 2 : a, d, g, z

Answer Should be : a, b, c, g, e, z

Thanks for your help guys,

[sig]<p>Matthew Wall<br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
GOT IT!

<CFLOOP INDEX=&quot;ThisRootWord&quot; LIST=&quot;#tempRootKeywordList#&quot;>
<cfset NewWord = ListFindNoCase(TheFinalList, ThisRootWord)>
<CFIF NewWord EQ 0>
<cfset TheFinalList = ListAppend(TheFinalList, ThisRootWord)>
</cfif>
</CFLOOP> [sig]<p>Matthew Wall<br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top