plecs 发表于 2022-7-5 22:14:32

需要帮助删除“(pa

((0 0 0 Hz 2.5x20 0 0 0 0 Accesoriu 0) . 56)
((795 757 0 SP_PFL_2 0 0 0 0 101PE Alb Perlat3) . 1)
((764 100 0 TRAV_2 1 0 0 0 101PE Alb Perlat18) . 2)
 
这样地
 
0 0 0 Hz 2.5x20 0 0 0 0 Accesoriu 0 56
795 757 0 SP_PFL_2 0 0 0 0 101PE Alb Perlat3 1
764 100 0 TRAV_2 1 0 0 0 101PE Alb Perlat18 2
 
这是rutime,但我不删除括号
 
(defun c:exptxt1111 ()
;;;--- Get a the data from the blocks
(if(setq dataList(getattData))
(progn
(setq dataListLength (length dataList))
        (setq        b (/ dataListLength 10))

(repeat b
(listofatt)
(setq   lst (reverse lst))
(setq mynewdata (appendmynewdata (list lst)))
(setq lst nil)
        );end repeat

);end progn
);end if

   (setq flist (LM:CountItems mynewdata))
(setq flist (reverse flist))
(setq ssa (length flist))


(setq filename "RaportPAL.txt")
(if (setq ofile (open filename "a"))
   (progn
       (foreach x flist (write-line (vl-princ-to-string x) ofile))
        ;(foreach x flist (write-line x ofile))
             (setq ofile (close ofile))
       T
   )
   )

(princ)
)
(princ)

Lee Mac 发表于 2022-7-5 22:35:09

请尝试以下操作:
 
(foreach x flist
   (write-line (substr (setq x (vl-princ-to-string (LM:flatten x))) 2 (- (strlen x) 2)) ofile)
)
(setq ofile (close ofile))
 
上面使用了我的展平函数。

plecs 发表于 2022-7-5 22:53:42

我想怎么做就怎么做
非常感谢你的帮助

plecs 发表于 2022-7-5 23:10:57

我几乎不知道如何去掉括号

Lee Mac 发表于 2022-7-5 23:29:06

不客气!
页: [1]
查看完整版本: 需要帮助删除“(pa