hosyn Posted July 26, 2020 Author Share Posted July 26, 2020 (edited) Now I was about checking it again Edited July 26, 2020 by hosyn Quote Link to comment Share on other sites More sharing options...
dlanorh Posted July 26, 2020 Share Posted July 26, 2020 Assuming (setq block-list '(("A-old" . 1) ("B-old" . 1) ("C-old" . 1) ("D-old" . 1) ("E-old" . 1) ("F-old" . 1) ("G-old" . 1) ("H-old" . 1))) (setq compare-list '((rgt "A-old" "A-new") (rgt "C-old" "C-new") (rgt "K-old" "K-new") (rgt "E-old" "E-new") (rgt "D-old" "D-new") (rgt "H-old" "H-new"))) Then the inelegant (mapcar '(lambda (x) (cons (cadr (assoc (car x) (mapcar 'cdr compare-list))) (cdr x))) (vl-remove-if-not '(lambda (x) (vl-position (car x) (mapcar 'cadr compare-list))) block-list)) produces the desired result 1 Quote Link to comment Share on other sites More sharing options...
hosyn Posted July 26, 2020 Author Share Posted July 26, 2020 20 minutes ago, Jonathan Handojo said: I'm not quite sure what you mean though. The function I wrote above should return the desired result Dear Jonathan Handojo Your code in example checked and its pretty good , but one issue in my data at the compare list there are space like that (rgt "PP" "PT SOCKET IP 54") These space can be conflict and mismatch running ? Quote Link to comment Share on other sites More sharing options...
hosyn Posted July 26, 2020 Author Share Posted July 26, 2020 Thank you to both Jonathan Handojo and dlanorh Your codes do best, thank you for helping guys Quote Link to comment Share on other sites More sharing options...
hosyn Posted July 26, 2020 Author Share Posted July 26, 2020 Hi and in continue (vl-...) function how should modified (setq compare-list '((rgt "A-old" "A-new") (rgt "C-old" "C-new") (rgt "K-old" "K-new") (rgt "E-old" "E-new") (rgt "D-old" "D-new") (rgt "H-old" "H-new"))) if blk-name be "c-old" give us "c-new" if blk-name be "k-old" give us "k-new" and ...... if blk-name theres not in compare-list give us nil So many thanks Thanks for any cooperating 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.