Leinad Posted August 20, 2016 Share Posted August 20, 2016 Hi, i have a problem opening the csv automatically, i modified tharwat code but its not open the csv after saving the csv in other folder location.. (defun c:C2XLS (/ sel f o l) (princ "\n Select All texts :") (if (and (setq sel (ssget '((0 . "TEXT")))) (setq f (getfiled "Save as to csv format " (getvar 'DWGPREFIX) "CSV" 1)) (setq o (open f "w")) ; this line not open ) (progn ((lambda (x / sn e) (while (setq sn (ssname sel (setq x (1+ x)))) (setq l (cons (list (cdr (assoc 10 (setq e (entget sn)))) (cdr (assoc 1 e))) l)) ) ) -1) (setq l (vl-sort l '(lambda (q p) (< (cadr (car q)) (cadr (car p)))))) (write-line "CHAINAGE,EASTING,NORTHING" o) (mapcar '(lambda (v) (write-line (strcat (cadr v) "," (rtos (caar v) 2) "," (rtos (cadar v) 2) "," (rtos (caddar v) 2)) o)) l) (close o) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 21, 2016 Share Posted August 21, 2016 What does the csv look like ? 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.