Jump to content

Recommended Posts

Posted

((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 Perlat  3) . 1)
((764 100 0 TRAV_2 1 0 0 0 101PE Alb Perlat  18) . 2)

 

like this

 

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 Perlat  3 1
764 100 0 TRAV_2 1 0 0 0 101PE Alb Perlat  18 2

 

this is rutime but i don t remove parentheses

 

(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 (append  mynewdata (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)

Posted

Try the following:

 

(foreach x flist
   (write-line (substr (setq x (vl-princ-to-string (LM:flatten x))) 2 (- (strlen x) 2)) ofile)
)
(setq ofile (close ofile))

 

The above uses my Flatten function from here.

Posted

I would hardly have figured out how to remove parentheses

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...