Computer Hope

Microsoft => Microsoft Windows => Windows Vista and 7 => Topic started by: pawantlor on June 03, 2015, 04:48:37 AM

Title: batch program + Find and replace
Post by: pawantlor on June 03, 2015, 04:48:37 AM
I have file which has some lines.. e.g.

line no 20    # Every Vagrant virtual environment requires a box to build off of.
line no 21         config.vm.box = "test_15_4"
line no 22    # The url from where the 'config.vm.box' box will be fetched if it
line no 23    config.vm.box_url = "file:\\d:\\images\\test.box"

I have set a variable "replace = test_15_5".. and "Search = config.vm.box"

I need a batch code which will search "config.vm.box" in file and replace next string "test_15_4"  with %replace%.. Code should replace every occurrence in file.

Need this urgently... please help me...