windows - Read variable values from file in CMD -
i new windows shell scripting
i have text file contents in following format
input.txt find1=replace1 find2=replace2 find3=replace3
i have set of windows commands like
findandreplace.exe -r "*.java" find1 replace1 findandreplace.exe -r "*.java" find2 replace2 findandreplace.exe -r "*.java" find3 replace3
i want make script reads each find-replace pair input.txt , performs above steps
as suggested, command should of use here. split line 2 variables, %%a , %%b you. remove echo
when produces commands want.
for /f "usebackq tokens=1,2 delims==" %%a in (`type "input.txt"`) ( echo findandreplace.exe -r "*.java" %%a %%b )
Comments
Post a Comment