I want to replace OLD
with %NEW%
in test.txt
by using a batch file:
@echo off
set /p NEW=""
set InputFile=test.txt
find OLD
replace %NEW%
my test.txt contains various characters like ~
:
;
_
.
which I attribute to various solutions clapping out.
I have attempted to use BatchSubstitude.bat to achieve this but it does not "find" OLD
and does not replace any text.
I have also attempted to use fart.exe but I receieve an error when trying to perform this:
find_string="OLD"
replace_string="test"
actual find_length=3
actual replace_length=4
processing \filepath\,test.txt
skipping binary file: \filepath\test.txt
The documentation for this is sparse and nothing I could google furiously would provide a solution.
The reason I am using batch for the moment is that I perform various windows CE actions such as cecopy, pdel and rapistart for windows CE deployment over activesync and batch seems to be the easiest way to to get the result that I am after - and I'm a total noob at batch.
Does anyone know how this can be achieved with batch and perhaps explain how the various functions work to achieve this?
Cheers!
Try this: