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:
- Open the command prompt, by searching for CMD
- Open a powershell by typing in
powershell
- cd to the folder the files are in
- and try this command
get-childitem *.pdf | foreach {rename-item $_ $_.name.replace(" ","")}
replace pdf with whatever the relevant extension is
That’s it, works beautifully!
Thank you!! This has saved me hours and hours of typing, renaming and deleting every single space off the hundreds of Atari 2600 binary files that I downloaded to play on my Flashback I got for Christmas š
Thanks again! Happy Christmas!
Merry Christmas, Steve! So happy that worked, enjoy your Flashback āŗļø
Beautiful, such time saver.
Following command replaces space with underscore
get-childitem *.png | foreach {rename-item $_ $_.name.replace(” “,”_”)}
Great! Completed in a jiffy!
what if you want to remove the spaces, not replace them?
Hi Carol, what I’m doing with this line:
get-childitem *.pdf | foreach {rename-item $_ $_.name.replace(" ","")}
is replace the space with nothing. There is nothing between the second quotation marks. It basically says replace
" "
[space] with""
[nothing].So it is removing the spaces. That’s all it does. I hope that helps!