RepCad Posted January 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
Tharwat Posted January 12, 2018 Share Posted January 12, 2018 Hi, Can you give a real example? Quote Link to comment Share on other sites More sharing options...
rlx Posted January 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
ronjonp Posted January 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
Grrr Posted January 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
ronjonp Posted January 12, 2018 Share 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 Link to comment Share on other sites More sharing options...
RepCad Posted January 12, 2018 Author Share Posted January 12, 2018 Thank you all guys, i used lee mac function that rlx introduced. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 13, 2018 Share 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 Link to comment Share on other sites More sharing options...
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.