Search and replace in a batch file

Hello all,

I am writing a batch file in DOS, one of its functions is to search through a file for a string of the format:

SOME TEXT WHICH MUST NOT CHANGE Version1.2 MORE CONSTANT TEXT

and replace it with:

SOME TEXT WHICH MUST NOT CHANGE Version1.3 MORE CONSTANT TEXT
or
SOME TEXT WHICH MUST NOT CHANGE Version 2 MORE CONSTANT TEXT

Depending on the values read from a different file.

I have found the function FIND which will find the entire line but I am not sure how to extract the Version and number and replace it.

FINDSTR also seems to almost do what I need but I having trouble making the final step and I cannot find any example which already have this done.

Can anyone help?
[765 byte] By [SteveTaylor] at [2007-11-20 5:14:33]
# 1 Re: Search and replace in a batch file
Take a look at this ( http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/findstr.mspx?mfr=true) Microsoft documentation. It should answer your questions.
PeejAvery at 2007-11-10 3:40:07 >
# 2 Re: Search and replace in a batch file
Thanks for the link.

I do not know if I am being blind but I cannot find information on how to do a string replace on there?
SteveTaylor at 2007-11-10 3:41:07 >
# 3 Re: Search and replace in a batch file
Well, findstr does exactly as its name says. What you need is to do regular expressions. Regular expressions cannot be done in DOS.
PeejAvery at 2007-11-10 3:42:06 >