You should be able to work this out as you have numerous posts now.
do this
(setq ss (ssget (list (cons 0 "TEXT")(cons 410 (getvar 'ctab)))))
So just make a list (text X Y Z) just get each item in the ss look at DXF 1 and DXF 10. Or VL textstring and insertionpoint
Then use
(setq lst (vl-sort lst '(lambda ( a b ) (< (car a) (car b)))))
Then just write a csv file.