I have a properties file build.properties with following information :
conf.major.number=1
conf.minor.number=0
core.major.number=3
core.minor.number=2
And I want my batch script to fetch the values from conf.major.number and conf.minor.number and result the output as 1.0 and set it to a variable "version"
and when I give echo %version% the output shoud be 1.0
for /f "skip=1 delims== tokens=2" %%a in (build_info.properties) DO (set "version=%%a")
echo %version%
core.major.number=1
core.minor.number=0
The above lines should be ignored and I dont know how to skip reading those lines.
Kindly help,
Thanks
Here is the solution and it works perfectly thanks @JosefZ
@ECHO OFF SETLOCAL EnableExtensions EnableDelayedExpansion
set VER_FILE="tldconfrev.number"
set /p id=Enter Ant target to be called "revision" or "hi":
set /p flag=Do you want the version file to be updated to perforce (Y/N):
echo(%id%
if /I "%id%"=="revision" (
if /I "%flag%"=="Y" (
for /f "delims=" %%a in (
'type "build_info.properties"^|find "="'
) DO (
set "_%%a"
)
set _
set "version=!_conf.major.number!.!_conf.minor.number!"
echo version=!version!
pause
)
)