0 Members and 1 Guest are viewing this topic.
;======================================================================== ;= Function PARSE_NUMS (string) ;= Arguments: string - Text string to be comma parsed ;= Returns: A list of the elements of the string converted to numbers ;= Copyright Jeff Winship 2003. All rights reserved. ;= www.pixelgraphicsinc.com ;===============================================================3/30/2003(defun parse_nums (st / a k lst) (setq k 1) (setq a "") (setq lst nil) (repeat (strlen st) (if (= (substr st k 1) ";") (progn (setq lst (append lst (list (atof a)))) (setq a "") ) (setq a (strcat a (substr st k 1))) ) (setq k (+ k 1)) ) (setq lst (append lst (list (atof a)))))(defun c:placetext () (setq f (open "D:/Prasad-Test/sample.txt" "r")) ;-Open the data file (setq dataline (read-line f)) ;-Read the header line (setq dataline (read-line f)) ;-Read the 1st data line (while (/= dataline "EOF") ;-Loop until end of file (setq dataline (parse_nums dataline)) ;-Parse the data line (command "DTEXT" car (dataline) , "2" , "0" ,cdr (dataline) "") ;-place text (setq dataline (read-line f)) ;-Read the next data line ) (close f) ;-Close the file!!!)
copyright? interesting
All program code on this site was written by me, so if you decide to use some of the code fragments and examples in your own work, please respect the work and keep my copyright info in the code. A link from your site would be appreciated as well.
Thanks Tharwat, This code is working perfect.Thanks
In this code every time i need to select notepad manually. I required to set notepad path as static.
I have replaced path, it is showing below error:; error: no function definition: c:/MyFolder/MyFile
(setq f "c:/MyFolder/MyFile.txt")