Re: Batch Rename from CSV
The obvious (vl-file-rename filedata) to what filename
Not looking very hard or tested in any way
{code]
(defun C:CSV2FILE (/)
(setq filelist (open "C:/LISP Directory/filelist.csv" "r"))
(setq filedata (read-line filelist)) ; dummy to read heading
(while (setq nline (read-line filelist))
(setq filedata (LM:str->lst nline ","))
(vl-file-rename (nth 0 filedata)(nth 1 filedata))
)
(close filelist)
)
)[/code]
Be careful if directory has spaces in the name may fail.
Re: Batch Rename from CSV
Excellent! It worked perfectly.
(nth # [list]) was exactly what I was looking for.
I ended up building a BAT file to do it, I knew it had to be pretty straightforward, I just couldn't find the little element to pull it all together. Now I can incorporate this into the full routine for updating these DWGs and not have to do the file rename separate from the rest of the process.