RepCad Posted January 12, 2018 Posted January 12, 2018 hi all, i need a function to find duplicate value or text in a list. can someone help me?? thanks in advance. Quote
rlx Posted January 12, 2018 Posted January 12, 2018 (edited) http://www.cadtutor.net/forum/showthread.php?53600-duplicate-items-on-list If you scroll down the page of a (any) thread you see 'Similar Threads' ... this should help you in your search or : http://www.lee-mac.com/uniqueduplicate.html gr. Rlx Edited January 12, 2018 by rlx Quote
ronjonp Posted January 12, 2018 Posted January 12, 2018 Maybe something as simple as this: (defun foo (item lst) (vl-remove-if-not '(lambda (x) (equal item x)) lst)) ;; (foo "1" '("1" "2" "3" "1" "1" "5" "1.0")) Quote
Grrr Posted January 12, 2018 Posted January 12, 2018 Ron, _$ (foo "1" '("1" "2" "3" "1" "1" "5" "1.0")) ("1" "1" "1") If he ment 'duplicate value' then "1.0" should be returned aswell, I think. The OP should provide a sample list... and what he expects to be returned. Quote
ronjonp Posted January 12, 2018 Posted January 12, 2018 Agreed .. just a quick example, not full blown solution. My guess is the OP probably want's a fuzz value too for numbers that should be 'equal'. Quote
RepCad Posted January 12, 2018 Author Posted January 12, 2018 Thank you all guys, i used lee mac function that rlx introduced. Quote
Lee Mac Posted January 13, 2018 Posted January 13, 2018 Thank you all guys, i used lee mac function that rlx introduced. Glad it helped! Thanks for the recommendation rlx Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.