{"id":1005,"date":"2020-06-17T15:40:17","date_gmt":"2020-06-17T19:40:17","guid":{"rendered":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/?p=1005"},"modified":"2022-12-25T17:12:25","modified_gmt":"2022-12-25T22:12:25","slug":"removing-spaces-from-filenames-on-windows","status":"publish","type":"post","link":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/2020\/removing-spaces-from-filenames-on-windows\/","title":{"rendered":"Removing Spaces from Filenames on Windows"},"content":{"rendered":"\n<p>I received 60 documents to put online, beautifully named, but with SPACES!!! Aaaah!<\/p>\n\n\n\n<p>Thankfully, you can bulk remove them in a powershell: hooray! <a rel=\"noreferrer noopener\" href=\"https:\/\/stackoverflow.com\/questions\/11270453\/how-to-remove-spaces-from-file-names-in-bulk#answer-57024645\" target=\"_blank\">This simple, understandable and beautiful solution on Stack Overflow<\/a> shows you how:<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the command prompt, by searching for CMD<\/li>\n\n\n\n<li>Open a powershell by typing in <code>powershell<\/code><\/li>\n\n\n\n<li>cd to the folder the files are in<\/li>\n\n\n\n<li>and try this command<br><code>get-childitem *.pdf | foreach {rename-item $_ $_.name.replace(\" \",\"\")}<\/code><br>replace pdf with whatever the relevant extension is<\/li>\n<\/ul>\n\n\n\n<p>That&#8217;s it, works beautifully!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received 60 documents to put online, beautifully named, but with SPACES!!! Aaaah! Thankfully, you can bulk remove them in a powershell: hooray! This simple, understandable and beautiful solution on Stack Overflow shows you how:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[178,180,179,181,35],"class_list":["post-1005","post","type-post","status-publish","format-standard","hentry","category-new-things","tag-command-prompt","tag-file-names","tag-powershell","tag-renaming-files","tag-stack-overflow","infinite-scroll-item"],"_links":{"self":[{"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/posts\/1005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/comments?post=1005"}],"version-history":[{"count":2,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/posts\/1005\/revisions"}],"predecessor-version":[{"id":1227,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/posts\/1005\/revisions\/1227"}],"wp:attachment":[{"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/media?parent=1005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/categories?post=1005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blindemanwebsites.com\/today-i-learned\/wp-json\/wp\/v2\/tags?post=1005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}