{"id":4643,"date":"2021-11-11T08:10:37","date_gmt":"2021-11-11T08:10:37","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=4643"},"modified":"2021-11-11T08:12:13","modified_gmt":"2021-11-11T08:12:13","slug":"batch-to-move-files-based-on-partial-name","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-to-move-files-based-on-partial-name\/25266.html","title":{"rendered":"Batch To Move Files Based On Partial Name"},"content":{"rendered":"<p>I have folder (let&#8217;s say it&#8217;s e:\\images) with thousands of pictures, all with the following naming conventions:<\/p>\n<p>s_4587.jpg<br \/>\ns01_4587.jpg<br \/>\ns_10293.jpg<br \/>\ns01_10293.jpg<br \/>\ns02_10293.jpg<br \/>\netc.<\/p>\n<p>Basically, the number in the name specifies what the image is. s indicates that it is the first image of that particular item, s01 is the second, s02 the third, and so on. I&#8217;m not sure why they were named this way, but I need to move them all into their own folders (creating that folder if it does not exist already) based on the number in the file name and am at a loss as to how to do this. Does anyone know how to create a batch file for this? This is something I used to be able to figure out, but haven&#8217;t touched a batch file in years and have no idea where to begin anymore. I&#8217;m no coder, so anything I&#8217;ve ever done has been trial and error, and I don&#8217;t have tons of time to spend on this.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":10},"question-category":[55],"question_tags":[],"class_list":["post-4643","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/4643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=4643"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=4643"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=4643"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=4643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}