matlab - List files that don't have any extension using command `dir` -


in directory containing files different extensions, e.g. .ext1, .ext2, , (no extension), how can use dircommand list files don't have extension?

the command dir(fullfile('path/to/dir','*.ext1')) list .ext1 files, don't know of option read extension-less files.

try if following fits needs:

allfiles = dir filelist = {allfiles(3:end).name}  mask = cellfun(@isempty, regexp( filelist ,'[^\\]*(?=[.][a-za-z]+$)','match')) output = filelist(mask) 

the regular expression finds filenames have extension , returns empty array if not. therefore cellfun(@isempty, ... ) give desired mask.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -