;; | ---------------------------------------------------------------------------- ;; | TX_File2Lst ;; | ---------------------------------------------------------------------------- ;; | Function : Read a text file and capture all its lines information into a ;; | list ;; | Arguments: 'fn' - File name ;; | Returns : A list of all the lines ;; | Updated : April 13, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun TX_File2Lst( fn / Lst lstr cnt fptr ) (setq fptr (open fn "r") Lst '() ) (if fptr (progn (if #Verbose (princ "\n") ) (setq cnt 1) (while (setq lstr (read-line fptr)) (if #Verbose (princ (strcat "\rReading file: " fn "..." (itoa cnt))) ) (setq Lst (cons lstr Lst) cnt (1+ cnt) ) ) (close fptr) )) (reverse Lst) )