If I have a list such as :
("myfile1.dwg" "myfile2.dwg" "myfile3.dwg" etc .....)
how would I strip the .dwg from all the elements, so that the list would
look something like:
("myfile1" "myfile2" "myfile3" etc .....)
thanks Russ
If I have a list such as :
("myfile1.dwg" "myfile2.dwg" "myfile3.dwg" etc .....)
how would I strip the .dwg from all the elements, so that the list would
look something like:
("myfile1" "myfile2" "myfile3" etc .....)
thanks Russ
(foreach n mylist (setq newlist (append newlist (substr n 1 (- (strlen n)
4)))))
(setq mylist newlist newlist nil)
Did not test but this is how to do it assuming of course that length of the
extension is the same.
Another approach that would work is stepping thru each letter of the string
until you find the period then crop it off there.
Rodney
"Kiwi Russ" <russell@pl.net> wrote in message news:41cb6a31_2@newsprd01...
If I have a list such as :
("myfile1.dwg" "myfile2.dwg" "myfile3.dwg" etc .....)
how would I strip the .dwg from all the elements, so that the list would
look something like:
("myfile1" "myfile2" "myfile3" etc .....)
thanks Russ
(mapcar 'vl-filename-base mylist)
Ken Krupa
"Kiwi Russ" <russell@pl.net> wrote in message news:41cb6a31_2@newsprd01...
If I have a list such as :
("myfile1.dwg" "myfile2.dwg" "myfile3.dwg" etc .....)
how would I strip the .dwg from all the elements, so that the list would
look something like:
("myfile1" "myfile2" "myfile3" etc .....)
thanks Russ
Russ
Ken Krupa reply
(mapcar 'vl-filename-base mylist) is a good one
it also works for all file types
(setq MyList '("myfile1.lsp" "myfile2.lsp" "myfile3.lsp" "myfile42.lsp"))
(mapcar 'vl-filename-base MyList)
result :
("myfile1" "myfile2" "myfile3" "myfile42")
so it's can replace some code in that MakefasM routine!
Damn it, I'm going to have to learn more visual lisp!!
Cheers
Rob
File, Find References, Copy Files: Truncating Long File Name
ROMANS.SHX is a normal text font file, not a shape file