Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Comparing text lists.

Community Beginner ,
Sep 29, 2010 Sep 29, 2010

Help – been up all night and brain is flat…

I have a text list, which I need to compare with n-amount of other lists.  IE:

Original list: “beer, whisky, wine, vodka, tequila”

Then I have:

List 2: “beer, chocolate, nuts”

List 3: “whisky, bacon, beer”

List 4: “chocolate, bacon”

Etc…

I need a script that compares my original list with list 2, 3 & n, and return the list number that matches ANY of the list elements.  IE my result set would be “2, 3”.  (the ID of the lists returned as a valuelist)

Bonus point if you can arrange them by the amount of matches – “3, 2” – but non-essential. 

Point me in the right direction please!

445
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 29, 2010 Sep 29, 2010

I would suggest starting out at cflib.org and do a search for "list"--there are a billion ready-made scripts for comparing/parsing/transforming lists that, while they may not knock out your solution in one fell swoop, will at the very least get you started in the right direction.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 29, 2010 Sep 29, 2010
LATEST

Try this link

http://ppshein.wordpress.com/2010/06/16/compare-list-in-coldfusion/

as it returns a matching list, you can work out the number of matches per list too...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources