- ;|
- ;;;整理数据:
- (setq Lst (list (list a1 b1 c1 d1)
- (list a2 b2 c2 d2)
- (list a3 b3 c3 d3)
- (list a4 b4 c4 d4)
- (list a5 b5 c5 d5)
- (list a6 b6 c6 d6)
- (list a7 b7 c7 d7)
- ))
- |;
- ;;;得到实际数据:
- (setq Lst '(("wl1" "AL1" "单相" "1.44")
- ("wl2" "AL1" "单相" "2")
- ("wl3" "AL1" "三相" "5")
- ("wl1" "AL2" "单相" "2")
- ("wl2" "AL2" "单相" "2")
- ("wl3" "AL3" "三相" "2")
- ("wp2" "AL2" "三相" "4")
- ))
- ;;;实际数据排序函数:
- (defun sort-lst (Lst)
- (setq Lst (mapcar '(lambda(x) (list (cadr x) (car x) (caddr x) (cadddr x))) Lst))
- (setq Lst (vl-sort Lst '(lambda(x y) (< (nth 3 x) (nth 3 y)))))
- (setq Lst (vl-sort Lst '(lambda(x y) (< (nth 2 x) (nth 2 y)))))
- (setq Lst (vl-sort Lst '(lambda(x y) (< (nth 1 x) (nth 1 y)))))
- (setq Lst (vl-sort Lst '(lambda(x y) (< (nth 0 x) (nth 0 y)))))
- (princ "\n")
- (mapcar '(lambda(x)
- (princ "\n")
- (mapcar '(lambda(y) (princ y) (princ "\t")) x)
- ) Lst)
- (princ "\n")
- (princ)
- )
- ;;;执行数据排序:
- (sort-lst Lst)
|