 - ;;;
- (setq lst '(("AAA" "BBB" ) ("CCC" "DDD") ("ABC" "BBB") ("CDF" "BBB")))
- (test lst) ->(("AAA,ABC,CDF" "BBB") ("CCC" "DDD"))
- ;;;
- (defun test (lst / nlst)
- (mapcar '(lambda(x)(setq xx (cadr x))
- (if (not(apply 'or (mapcar '(lambda(y)(setq yy (cadr y))
- (if (and xx yy (= xx yy))
- (setq nlst (subst (list (strcat (car y) "," (car x)) yy) y nlst))
- nil
- )
- )
- nlst)))
- (setq nlst (cons x nlst))
- )
- ) lst)
- (reverse nlst)
- )
|