Reputation: 455
Can someone help me to remove spaces in a filename of windows.
Example:
ABCD001 _V01.DOC >>>> ABCD001_V01.DOC
ABCD002 _V01.DOC >>>> ABCD002_V01.DOC
Thank you.
Upvotes: 0
Views: 3060
Reputation: 8396
Using renamer:
$ renamer --find "/\s/g" --dry-run *
This will remove all whitespace from filenames in the current directory. Once you're happy the output looks correct, remove the --dry-run
flag.
Upvotes: 1
Reputation: 41234
Test this on some sample files first:
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in ('dir /b /a-d') do (
set "line=%%~nxa"
ren "%%a" "!line: =!"
)
Upvotes: 0