{"id":2324,"date":"2008-09-09T09:38:51","date_gmt":"2008-09-09T14:38:51","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/09\/advanced-matlab-file-name-processing-from-directory-listing\/"},"modified":"2016-05-18T11:29:41","modified_gmt":"2016-05-18T15:29:41","slug":"advanced-matlab-file-name-processing-from-directory-listing","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/09\/advanced-matlab-file-name-processing-from-directory-listing\/","title":{"rendered":"Advanced MATLAB: File name processing from directory listing"},"content":{"rendered":"<p>Very often MATLAB users want to be able to process a set of files from a directory. In this video, I show how you can look through a directory seeking files of the form &#8220;data###.dat&#8221; and then returning the &#8220;###&#8221; as a number with any leading zeros removed. This makes use of regular expressions, but does not explain their theory much at all.<\/p>\n<p><embed src=\"https:\/\/blogs.mathworks.com\/images\/pick\/FlashVideos\/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CplayList%3A%5B%7BsuggestedClipsInfoUrl%3A%27120%20see%20also%2Etxt%27%2Curl%3A%27120%20Basics%20File%20processing%20workflow%2Eflv%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fblogs%2Emathworks%2Ecom%2Fimages%2Fpick%2FFlashVideos%2F%27%2CsplashImageFile%3A%27120%20Basics%20File%20processing%20workflow%2Ejpg%27%2Cloop%3Afalse%2CinitialScale%3A%27fit%27%2CshowFullScreenButton%3Afalse%2CautoBuffering%3Afalse%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%5D%2CautoPlay%3Afalse%7D\" type=\"application\/x-shockwave-flash\" width=\"300\" height=\"265\"><\/embed><\/p>\n<p>This is not the first time this kind of thing has been discussed. Check out <a href=\"https:\/\/blogs.mathworks.com\/loren\/2006\/08\/02\/processing-a-set-of-files\/\">Loren&#8217;s take<\/a>, or <a href=\"https:\/\/blogs.mathworks.com\/steve\/2006\/06\/06\/batch-processing\/\">Steve&#8217;s take<\/a> from their blogs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Very often MATLAB users want to be able to process a set of files from a directory. In this video, I show how you can look through a directory seeking files of the form &#8220;data###.dat&#8221; and&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/09\/09\/advanced-matlab-file-name-processing-from-directory-listing\/\">read more >><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,8,2],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2324"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2324"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2324\/revisions"}],"predecessor-version":[{"id":7345,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2324\/revisions\/7345"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}