chvnprasad Posted July 21, 2014 Share Posted July 21, 2014 Sample.txtHi I need a lisp to place text as per given data in notepad. Innotepad Coordinates and Text is delimited with Semicolon ( symbol. Need toread from notepad and place text as per Coordinate. Thanks in Advance. Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 21, 2014 Share Posted July 21, 2014 You may build by yourself a script from that file; use Excel to speed-up the process. _TEXT [color=magenta]0,0[/color] 5.0 0.0 [color=magenta]NAME1[/color] _TEXT [color=magenta]1,1[/color] 5.0 0.0 [color=magenta]NAME2[/color] _TEXT [color=magenta]2,2[/color] 5.0 0.0 [color=magenta]NAME3[/color] _TEXT [color=magenta]3,3[/color] 5.0 0.0 [color=magenta]NAME4[/color] <end of script> Quote Link to comment Share on other sites More sharing options...
chvnprasad Posted July 21, 2014 Author Share Posted July 21, 2014 Thanks for Quick reply. Actually i need a lisp. I am reading datafrom another software and save in notepad using Delimiter. based on this inputs from notepad lisp automatically need to place text. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 21, 2014 Share Posted July 21, 2014 Here is the codes that I did post in the SWAMP . (defun c:Test (/ f o Deconstruct_String cm st l) (if (and (setq f (getfiled "Select Txt file " "" "txt" 16)) (setq o (open f "r")) ) (progn (defun Deconstruct_String (st delimiter / p l) ;; Tharwat 01. Nov. 2012 ;; (while (setq p (vl-string-search delimiter st 0)) (setq l (cons (substr st 1 p) l) st (substr st (+ p 2) (strlen st)) ) ) (if st (setq l (cons st l)) ) (setq l (reverse l)) ) (setq cm (getvar 'CMDECHO)) (setvar 'CMDECHO 0) (while (setq st (read-line o)) (setq l (Deconstruct_String st ";")) (if (and l (vl-string-search "," (car l)) (eq (length l) 2)) (vl-cmdf "_.TEXT" (car l) (getvar 'TEXTSIZE) "0." (cadr l)) ) ) (setvar 'CMDECHO cm) (close o) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.