windows - For loop reading file names with spaces -
i'm trying scan files in directorys text inside, whenever come across file has ' - copy' added end of windows, program not read it. i've tried using quotes within name being passed, no dice.
for /r %%f in (*.cdp) ( /f "tokens=*" %%a in (%%~nxf) ( i've been using code , have no issues typical files im seeing. if dummy_file - copy, error program saying 'system cannot find file dummy_file.' period included. if use
for /r %%f in (*.cdp) ( /f "tokens=*" %%a in ("%%~nxf") ( then second loop gets skipped, , program proceeds on. thought made loop take string literal, apparently loop has own way of reading things.
is possible accept files in loop have - copy in them? able use dummy_file - copy.cdp here?
for /r %%f in (*.cdp) ( /f "usebackq delims=" %%a in ("%%~ff") ( changes:
instead of retrieving tokens, code disables delimiters
as file name quoted,
usebackqinclude indicate not processing direct string, file contentsas code recurses folders, if idea read file contents instead of directly using file name , extension, full path needed file location can differ current directory
Comments
Post a Comment