I need to extract the Major , Minor and Revision numbers from a string and to achieve this I\'m trying to split a string in a batch file using a \'.\' character as the delim
Here you go...
@ECHO OFF & SETLOCAL
set /p "ReleaseVersion=Please specify the software release version : "
for /F "tokens=1,2,3 delims=." %%a in ("%ReleaseVersion%") do (
set Major=%%a
set Minor=%%b
set Revision=%%c
)
echo Major: %Major%, Minor: %Minor%, Revision: %Revision%
Input/output:
Please specify the software release version : 1.0.2
Major: 1, Minor: 0, Revision: 2