I have a somewhat complex search and replace that I need to do. I am using a batch file that loops over and executes fart.exe and I am trying to input strings from two different arrays into the "search" field and the "replace" field.
Everything is working EXCEPT that setting the final variables is not working, they are inserted into the commands as empty strings. How do I get the value of my arrays into those variables?
Note that the reason I am searching for the ID and not replacing it is because that is part of the verification that I am replacing the correct link.
My code:
setlocal EnableDelayedExpansion
set i=0
for /F %%a in (merchants.txt) do (
set /A i+=1
set merArray[!i!]=%%a
)
for /F %%b in (merchant-ids.txt) do (
set /A i+=1
set idArray[!i!]=%%b
)
set n=%i%
for /L %%i in (0,1,%n%) do (
set merDom=!merArray[%%i]!
set merID=!idArray[%%i]!
echo !merArray[%%i]!
fart.exe -i -r "C:\css_js_test\*.css" http://%merDom%/merchant/%merId%/ http://www.example.com/merchant/%merId%/
)
pause