Assuming you mean columns instead of rows, try the following:
(defun c:dimtxtexp ( / des dim enx idx sel txt )
(if (and (setq sel (ssget '((0 . "TEXT,MTEXT,*DIMENSION"))))
(setq des (open "f:\\BrianD\\Dims.csv" "a"))
)
(progn
(repeat (setq idx (sslength sel))
(setq enx (entget (ssname sel (setq idx (1- idx)))))
(if (wcmatch (cdr (assoc 0 enx)) "*DIMENSION")
(setq dim (cons (rtos (cdr (assoc 42 enx))) dim))
(setq txt (cons (cdr (assoc 1 enx)) txt))
)
)
(while (or dim txt)
(write-line
(strcat
(cond ((car txt)) ("")) ","
(cond ((car dim)) ("")) ","
(cond ((cadr dim)) (""))
)
des
)
(setq txt (cdr txt)
dim (cddr dim)
)
)
)
)
(if (= 'file (type des)) (close des))
(princ)
)