I would like to know if there is a way where I can use a for loop on an expanded variable.
Is it something recommended or which can be done?
I have a script which reads a text file which has many dimensions such as State%%20Country
, City%%20Country
, etc. I save them into a variable (lets call it !P!
). So !P1!
now has:
!P1!
City%%20Country
State%%20Country
...
The script runs a for loop and reads each row and based on that the value of !P1!
changes.
I would like to know or appreciate if some one can let me know I can loop over the variable as I would like to replace the %%20
which is part of the string contained in !P1!
with Space.
So what I am trying is :
for /F "delims==" %%A in ('!P1!') do ...
I know this wont work, but can someone let me know if there is a way to do this or if this is the right approach?