In a directory containing files with different extensions, for example. .ext1, .ext2and (without extension), how can I use the command dirto list only files that do not have an extension?
.ext1
.ext2
dir
The command dir(fullfile('path/to/dir','*.ext1'))will list all the files .ext1, but I do not know any option to read files with the extension without restrictions.
dir(fullfile('path/to/dir','*.ext1'))
Try it if the following meets all your needs:
allfiles = dir filelist = {allfiles(3:end).name} mask = cellfun(@isempty, regexp( filelist ,'[^\\]*(?=[.][a-zA-Z]+$)','match')) output = filelist(mask)
, , , . cellfun(@isempty, ... ) .
cellfun(@isempty, ... )
Source: https://habr.com/ru/post/1609660/More articles:JVM arguments for HTTPS nonProxyHosts - javaStandard content template for pattern matching - content-typeC followed by a comma separator - cHaxe CreateInstance and Properties - reflectionAdb returns โdevice not foundโ in recovery mode - androidWebsphere HibernatePersistence is incompatible with PersistenceProvider - java-eeHow to import npm module with limited name installed from github? - javascriptProblem creating WebSphere 7 EntityManagerFactory - jpaPersistence deployment issue - javaScrapy - output multiple JSON files - jsonAll Articles