You are not logged in.
When in a batch using FOR /F %%K (whatever) do (command)
I wish to do in the command string manipulation with %%K , so I use
set _temp=%%K
and then set _new=!_temp:0,-2% (as example)
Is there any way to use %%K instead of that intermediate variable?
I tried some combinations with %%K to no luck...
How to proceed for same with subroutines, where we have %1, %2 etc.
TIA
Offline
There are a few ways you can work with substrings of %%K but these are based around file name manipulation, rather than slicing at offsets.
For example:
%%~K removes surrounding quotes
%%~fxK gets the file name and extension, such as the "Some file.ext" part of "C:\Some Dir\Some file.ext"
%%~dpK gets the disk and path part, such as "C:\Some Dir\"
Unless one of the available modifications work for your use case, you're stuck using an intermediate variable.
cmd | *sh | ruby | chef
Offline