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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -