I am trying to perform string comparison and extraction in a batch file. The operation is performed by a set of folder names from the SVN repository.
for /f %%f in ('svn list https://dev_server/svn/product/branches') do (
set folder=%%f
echo Folder: %folder%
:: get substring from %folder% starting at 0 with a length of %length%
:: if this substring is equal to %folderStart% then get substring from %folder% starting at position %length%
)
There are several issues here:
- The value %% f is not assigned to% folder% for any reason.
- Despite the fact that I searched on the Internet many times, I did not find a solution for a variable-length substring. Batch file substring function: ~ only seems to accept fixed integer values.
Does anyone have an idea how I could implement the functions in the comments section in the code above?
source
share