How to Exclude Files from vl-directory-files

How to Exclude Files from vl-directory-files

whitt0213
Contributor Contributor
362 Views
2 Replies
Message 1 of 3

How to Exclude Files from vl-directory-files

whitt0213
Contributor
Contributor

How can I exclude files from vl-directory-files if they contain a certain string of text in their name? I know how to select files if they contain text by using a wildcard (ex. ABR*.dwg) but how would I select only files that don't contain it (ex. every .dwg which doesn't have ABR in name)? 

0 Likes
Accepted solutions (1)
363 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

Possibly like this... like with any other list

 

(vl-remove-if '(lambda (x) (wcmatch x "*ABR*.*")) (vl-directory-files (getvar 'dwgprefix)))
0 Likes
Message 3 of 3

whitt0213
Contributor
Contributor
This is what I was looking for. I'm new to lisp and wasn't familiar with some of these functions, thanks.
0 Likes