One of the others ways to do this is to use a lisp and break the string into individual bits. As you have a "-" as a common item in the string you can blow it apart and rejoin. Thanks to Lee-mac parse lsp. Something like this.
; Parse string to a list ny Lee-mac
(defun csv->lst (str ans / pos )
(if (setq pos (vl-string-position ans str))
(cons (substr str 1 pos) (csv->lst (substr str (+ pos 2)) ans))
(list str)
)
)
(setq str "XXX-ZINC-XX-XX-DR-C-01000_S278 Sections") ; use (getvar 'dwgname)
(setq newstr "" x 0)
(setq ans (csv->lst str 45))
(repeat (- (length ans) 2)
(setq newstr (strcat newstr (nth x ans) "-"))
(setq x (1+ x))
)
(setq newstr (strcat newstr (nth x ans)))
Ps ; tab 9 space 32 (chr 32) comma 44 semicolon 59 slash / 47 - 45