npocmaka / batch.scripts

batch script utils and examples by npocmaka -
https://www.linkedin.com/in/npocmaka/
MIT License
1.06k stars 863 forks source link

how do you replace multiple strings with replacer.bat ? #50

Open maravento opened 1 year ago

maravento commented 1 year ago

Is there a way to replace multiple strings with a loop using replacer.bat?

call replacer.bat "content.txt" "foo" "bar" "xyz abc" "bla fart"
call replacer.bat "content.txt" "foo\bar" "xyz\abc" "bla\fart"

These commands don't work, the help isn't very helpful, and executing a command for each replacement is not something very optimized