Need help in overwriting a variable value inside a loop. Getting same value all the time for below loop.
I'm trying to get the value of App and Web from txt document. Below is the sample.
Code: Select all
@echo on
setlocal EnableDelayedExpansion
set package_check=App,Web
for %%b in (%package_check%) do (
for /f "tokens=1* delims=," %%x in (property_check.txt) do (
set %%x = %%y
if %%x == %%b (
set %%b=%y% echo %%b
)
)
)
property_check.txt
App, App1, App2
Web, Web1, Web2
Expected Output:
App = App1, App2
Web = Web1, Web2
Note: I have added values for App and Web in property_check.txt file.