PRINTING DOTS(.) TO A FILE

I WANT TO PRINT STRINGS CONTAINING DOTS TO A FILE WITHOUT THE QUOTATION MARKS, BUT USING "READ" TO STRIP THE MARKS TRUNCATES THE STRING AT THE DOT ITSELF. I HAVE TRIED USING "WRITE-CHAR" AND "WRITE-LINE" BUT I ALWAYS GET UNWANTED BLANK LINES IN THE FILE EITHER BEFORE OR AFTER THE STRING. AN EXAMPLE OF THE STRING IS "W37.5". HOW CAN I COMBINE ALPHA AND NUMERIC DATA IN A STRING AND PRINT TO A FILE WITHOUT THE QUOTATION MARKS?

Reply to
stephanie witkowski
Loading thread data ...

HiHo; This is from Cadalyst June 1997 tip 1336 Rename to wro.lsp ..................................................................... ;TIP1336.LSP: WRO.LSP Write Text to File (c)1997, David H. Wilde

(defun c:wro ( ) ;; stands for "write out" (setvar "filedia" 1) (setq lspdir "c:\\ALISPPRGM\\") ;; set to directory of default txt file (setq txtfile (strcat lspdir "notes")) ;;default txt file (setq filenm (open (getfiled "Write out text file." txtfile "txt" 11) "a")) ;;dialogue box to pick file to create or append (setq txt (ssget)) ;;be sure to pick lines as you want them to appear in the txt file (setq n (sslength txt)) (setq index 0) (repeat n (setq ln1 (ssname txt index)) (setq index (+ index 1)) (setq lname (entget ln1)) (setq line (assoc 1 lname)) (setq line1 (cdr line)) (write-line line1 filenm) ) (close filenm) );end wro.lsp ............................................................................ .................................................. Change lspdir to a directory of your choice and txtfile to a file of your choice. I hope I understood your request correctly. I also interperted it as a request to locate the dot in a text string, if that is the case let me know as I have a program that will do that.

Reply to
bestafor

HiHo; This is from Cadalyst June 1997 tip 1336 Rename to wro.lsp ..................................................................... ;TIP1336.LSP: WRO.LSP Write Text to File (c)1997, David H. Wilde

(defun c:wro ( ) ;; stands for "write out" (setvar "filedia" 1) (setq lspdir "c:\\ALISPPRGM\\") ;; set to directory of default txt file (setq txtfile (strcat lspdir "notes")) ;;default txt file (setq filenm (open (getfiled "Write out text file." txtfile "txt" 11) "a")) ;;dialogue box to pick file to create or append (setq txt (ssget)) ;;be sure to pick lines as you want them to appear in the txt file (setq n (sslength txt)) (setq index 0) (repeat n (setq ln1 (ssname txt index)) (setq index (+ index 1)) (setq lname (entget ln1)) (setq line (assoc 1 lname)) (setq line1 (cdr line)) (write-line line1 filenm) ) (close filenm) );end wro.lsp ............................................................................ .................................................. Change lspdir to a directory of your choice and txtfile to a file of your choice. I hope I understood your request correctly. I also interperted it as a request to locate the dot in a text string, if that is the case let me know as I have a program that will do that.

Reply to
bestafor

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.