俺比较喜欢简单的挣钱,试试看给你定制的吧
- (DEFUN C:TJWB(/ N SS STR_LST LST_STR STR1 SHUL STRLST )
- (SETQ SS(SSGET '((0 . "*TEXT"))))
- (SETQ N 0)
- (WHILE (< N (SSLENGTH SS))
- (SETQ LST_STR (APPEND LST_STR (LIST (CDR(ASSOC 1 (ENTGET (SSNAME SS N)))))))
- (SETQ N (1+ N))
- )
- (SETQ LST_STR (vl-sort LST_STR(function(lambda(x y) (< x y)))))
- (SETQ STRLSTLEN (LENGTH LST_STR))
- (WHILE LST_STR
- (SETQ SHUL(- STRLSTLEN(LENGTH(SETQ LST_STR(VL-REMOVE (SETQ STR1 (CAR LST_STR))LST_STR)))))
- (SETQ STRLST (APPEND STRLST (LIST(LIST STR1 SHUL))))
- (SETQ STRLSTLEN (LENGTH LST_STR))
- )
- (SETQ STRLST (append (list '("编号" "数量(个)"))STRLST ))
- (setq ff1 (getfiled "输出到excel" "文本统计" "CSV" 1))
- (setq ff2(open ff1 "a"))
- (setq i 0)
- (repeat (length STRLST)
- (SETQ lst_bzmp (nth i STRLST))
- (setq txt (vl-string-translate "( )" ",,,"(vl-princ-to-string lst_bzmp)))
- (setq txt (vl-string-subst "" "," txt))
- (write-line txt ff2)
- (setq i (1+ i))
- )
- )
|